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
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

relaxml
/
Llama-2-70b-E8P-2Bit

Text Generation
Transformers
Safetensors
llama
text-generation-inference
Model card Files Files and versions
xet
Community
4

Instructions to use relaxml/Llama-2-70b-E8P-2Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use relaxml/Llama-2-70b-E8P-2Bit with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="relaxml/Llama-2-70b-E8P-2Bit")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("relaxml/Llama-2-70b-E8P-2Bit")
    model = AutoModelForCausalLM.from_pretrained("relaxml/Llama-2-70b-E8P-2Bit")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use relaxml/Llama-2-70b-E8P-2Bit with vLLM:

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

    How to use relaxml/Llama-2-70b-E8P-2Bit 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 "relaxml/Llama-2-70b-E8P-2Bit" \
        --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": "relaxml/Llama-2-70b-E8P-2Bit",
    		"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 "relaxml/Llama-2-70b-E8P-2Bit" \
            --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": "relaxml/Llama-2-70b-E8P-2Bit",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use relaxml/Llama-2-70b-E8P-2Bit with Docker Model Runner:

    docker model run hf.co/relaxml/Llama-2-70b-E8P-2Bit
Llama-2-70b-E8P-2Bit
18.2 GB
Ctrl+K
Ctrl+K
  • 2 contributors
History: 4 commits
jc3464's picture
jc3464
6e87781b0fc86d5c7e9aa5307303dacd435ee4172b05890f105b25679e8a51f4
be01ee3 over 2 years ago
  • .gitattributes
    1.52 kB
    initial commit over 2 years ago
  • config.json
    834 Bytes
    6e87781b0fc86d5c7e9aa5307303dacd435ee4172b05890f105b25679e8a51f4 over 2 years ago
  • generation_config.json
    183 Bytes
    6e87781b0fc86d5c7e9aa5307303dacd435ee4172b05890f105b25679e8a51f4 over 2 years ago
  • model-00001-of-00002.safetensors
    9.99 GB
    xet
    f05f4b4f0fa7902a8fc46aadf3d354f9c13d455bce7c0d4b72047d5a923b2f52 over 2 years ago
  • model-00002-of-00002.safetensors
    8.2 GB
    xet
    4e1359873ecd3eecad41fccfd7ec7c803446982c732aff3f4dd5ae28f8f5c17c over 2 years ago
  • model.safetensors.index.json
    187 kB
    6e87781b0fc86d5c7e9aa5307303dacd435ee4172b05890f105b25679e8a51f4 over 2 years ago