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

aws-neuron
/
CodeLlama-7b-hf-neuron-24xlarge

Text Generation
Transformers
PyTorch
English
llama
facebook
meta
llama-2
inferentia2
neuron
Model card Files Files and versions
xet
Community
3

Instructions to use aws-neuron/CodeLlama-7b-hf-neuron-24xlarge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use aws-neuron/CodeLlama-7b-hf-neuron-24xlarge with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="aws-neuron/CodeLlama-7b-hf-neuron-24xlarge")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("aws-neuron/CodeLlama-7b-hf-neuron-24xlarge")
    model = AutoModelForCausalLM.from_pretrained("aws-neuron/CodeLlama-7b-hf-neuron-24xlarge")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use aws-neuron/CodeLlama-7b-hf-neuron-24xlarge with vLLM:

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

    How to use aws-neuron/CodeLlama-7b-hf-neuron-24xlarge 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 "aws-neuron/CodeLlama-7b-hf-neuron-24xlarge" \
        --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": "aws-neuron/CodeLlama-7b-hf-neuron-24xlarge",
    		"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 "aws-neuron/CodeLlama-7b-hf-neuron-24xlarge" \
            --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": "aws-neuron/CodeLlama-7b-hf-neuron-24xlarge",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use aws-neuron/CodeLlama-7b-hf-neuron-24xlarge with Docker Model Runner:

    docker model run hf.co/aws-neuron/CodeLlama-7b-hf-neuron-24xlarge
CodeLlama-7b-hf-neuron-24xlarge / compiled
Ctrl+K
Ctrl+K
  • 1 contributor
History: 1 commit
jburtoft's picture
jburtoft
Upload folder using huggingface_hub (#1)
f7c32cc over 2 years ago
  • 186a933115232053cdff.neff
    2.09 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • 540db8b9571300c15792.neff
    6.06 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • 585a14c8d348e11367d1.neff
    2.54 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • 6f0431e83e140df0acd9.neff
    1.93 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • 86a37b8c9f44ef0ad841.neff
    2.33 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • c5726de0e8bc3fd6f4c9.neff
    1.96 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • e0158d7717a18978a6c7.neff
    2.11 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • e87cecd034e5ac4c3f36.neff
    2.01 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • ea24e07b03ca7ec5310c.neff
    2.02 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago
  • fedc38910ff9aec1ce50.neff
    2.28 MB
    xet
    Upload folder using huggingface_hub (#1) over 2 years ago