Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

ltg
/
dual-lm-470m

Text Generation
Transformers
Safetensors
English
llama
language-model
dual-objective
autoregressive
masked-diffusion
causal-lm
masked-lm
custom_code
Eval Results (legacy)
text-generation-inference
Model card Files Files and versions
xet
Community

Instructions to use ltg/dual-lm-470m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use ltg/dual-lm-470m with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="ltg/dual-lm-470m", trust_remote_code=True)
    # pip install -U transformers accelerate
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("ltg/dual-lm-470m", trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained("ltg/dual-lm-470m", trust_remote_code=True, device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use ltg/dual-lm-470m with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "ltg/dual-lm-470m"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ltg/dual-lm-470m",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/ltg/dual-lm-470m
  • SGLang

    How to use ltg/dual-lm-470m with SGLang:

    Install from pip and serve model
    # Install SGLang from pip:
    pip install sglang
    # Start the SGLang server:
    python3 -m sglang.launch_server \
        --model-path "ltg/dual-lm-470m" \
        --host 0.0.0.0 \
        --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ltg/dual-lm-470m",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker images
    docker run --gpus all \
        --shm-size 32g \
        -p 30000:30000 \
        -v ~/.cache/huggingface:/root/.cache/huggingface \
        --env "HF_TOKEN=<secret>" \
        --ipc=host \
        lmsysorg/sglang:latest \
        python3 -m sglang.launch_server \
            --model-path "ltg/dual-lm-470m" \
            --host 0.0.0.0 \
            --port 30000
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:30000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "ltg/dual-lm-470m",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use ltg/dual-lm-470m with Docker Model Runner:

    docker model run hf.co/ltg/dual-lm-470m
dual-lm-470m
1.88 GB
Ctrl+K
Ctrl+K
  • 2 contributors
History: 7 commits
davda54's picture
davda54
Update modeling_dlm_llama.py
593c193 verified 6 months ago
  • .gitattributes
    1.52 kB
    initial commit 9 months ago
  • README.md
    11.8 kB
    Update README.md 6 months ago
  • __init__.py
    379 Bytes
    Upload Diffusion_Run_1:64_1x_fixed to main 6 months ago
  • config.json
    1.09 kB
    Upload Diffusion_Run_1:64_1x_fixed to main 6 months ago
  • configuration_dlm.py
    1.67 kB
    Upload 6 files 6 months ago
  • generation_config.json
    132 Bytes
    Upload Diffusion_Run_1:64_1x_fixed to main 6 months ago
  • model.safetensors
    1.87 GB
    xet
    Upload Diffusion_Run_1:64_1x_fixed to main 6 months ago
  • modeling_dlm.py
    18.6 kB
    Upload 6 files 6 months ago
  • modeling_dlm_llama.py
    24.7 kB
    Update modeling_dlm_llama.py 6 months ago
  • tokenizer.json
    3.65 MB
    Upload 6 files 6 months ago
  • tokenizer_config.json
    2.34 kB
    Upload 6 files 6 months ago