Text Generation
Transformers
Safetensors
English
llama
esper
dev-ops
developer
code
code-instruct
valiant
valiant-labs
code-llama
llama-2
llama-2-chat
70b
conversational
text-generation-inference
Instructions to use ValiantLabs/CodeLlama-70B-Esper with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ValiantLabs/CodeLlama-70B-Esper with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ValiantLabs/CodeLlama-70B-Esper") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ValiantLabs/CodeLlama-70B-Esper") model = AutoModelForCausalLM.from_pretrained("ValiantLabs/CodeLlama-70B-Esper", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ValiantLabs/CodeLlama-70B-Esper with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ValiantLabs/CodeLlama-70B-Esper" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValiantLabs/CodeLlama-70B-Esper", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ValiantLabs/CodeLlama-70B-Esper
- SGLang
How to use ValiantLabs/CodeLlama-70B-Esper 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 "ValiantLabs/CodeLlama-70B-Esper" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValiantLabs/CodeLlama-70B-Esper", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ValiantLabs/CodeLlama-70B-Esper" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValiantLabs/CodeLlama-70B-Esper", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ValiantLabs/CodeLlama-70B-Esper with Docker Model Runner:
docker model run hf.co/ValiantLabs/CodeLlama-70B-Esper
Commit History
-
card
Verified signature7d01655
-
model card (#2)
Verified signature- model card (6e9f0120c770ab0673fa0e7e8167944760c122dc) - Update README.md (3eb300a386706c34488f0a8574069914612da60f) - Update README.md (fe76a6bdece1f287e898501a542feafb66e3cfb4) - banners (f31f0417ad879322b60b7f12af8afefe04ccd840) Co-authored-by: scott <sequelbox@users.noreply.huggingface.co>13c5bb9
-
Upload folder using huggingface_hub (#1)
Verified signature- 003b6fd45056b617ab4c31129fb2eff8da66702a18a3b810b6b1641b0b797cad (2b425b17f7b26f6bf9b8437e8a774797c5270bf0) - c15d9e7826bb7fe53917561100f224f6919b70f5c24ceaf0c81efd1e8a97e7a7 (6c3c1c5c3362adb5dd7c914b4bb4bc548dcb9b34) - 7523aa1f578833177ec253bafbaba593c79201fdaa8d15d0ab779b4da9cb299b (85ddca705f5f286fbcaa8cbaf9832e00d330aa07) - e6ff1d68eb2cfaa1bfc372dcc2c8811b2d8085f5d4ed6d801399156c51e48f0e (7ca24b9e05b9e3e690aaecfbd5d4a1973d8f8218) - 19af47896599c94234772c46508a766134f873b3591c4cf664dd6a4f3dedf9c4 (fba230b3725506f5af9ed8fae7f2f07148c5b3ba) - 7b2d118517b2a1d5ada0e23441aee894c8e4ce154a1ee2656794f2d39f3d53eb (89840130da686546d37c2749d370e96a389e3e0e) - 0ab2e2e1b71d0b7066ec49bb5d338d58700e3aedd17990cc1b4696eecacc29f3 (d694df73c4ad47631d6ea75caf0e29071a06d06d) - f26cb951f809e320861790231963eac75ce463a6c2833a94db24481ab0af62f6 (47bb24af435c91bebf4e0177bff6b2d7ec8eaae7) - ce1234c8d52b9a33e2de71514df2ab06ebf38e151e8480b43a71571b2a1ecf61 (d3ed62b6d890206a87849a8f36eed55ab70a35cb) - b7698351…aa33d31 -
initial commit
Verified signature59a42ec