Text Generation
Transformers
PyTorch
TensorBoard
llama
Generated from Trainer
text-generation-inference
Instructions to use syedshoeb/llama-2-7b-int4-python-code-20k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use syedshoeb/llama-2-7b-int4-python-code-20k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="syedshoeb/llama-2-7b-int4-python-code-20k")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("syedshoeb/llama-2-7b-int4-python-code-20k") model = AutoModelForCausalLM.from_pretrained("syedshoeb/llama-2-7b-int4-python-code-20k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use syedshoeb/llama-2-7b-int4-python-code-20k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "syedshoeb/llama-2-7b-int4-python-code-20k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "syedshoeb/llama-2-7b-int4-python-code-20k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/syedshoeb/llama-2-7b-int4-python-code-20k
- SGLang
How to use syedshoeb/llama-2-7b-int4-python-code-20k 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 "syedshoeb/llama-2-7b-int4-python-code-20k" \ --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": "syedshoeb/llama-2-7b-int4-python-code-20k", "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 "syedshoeb/llama-2-7b-int4-python-code-20k" \ --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": "syedshoeb/llama-2-7b-int4-python-code-20k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use syedshoeb/llama-2-7b-int4-python-code-20k with Docker Model Runner:
docker model run hf.co/syedshoeb/llama-2-7b-int4-python-code-20k
Commit History
-
Adding `safetensors` variant of this model
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/safetensors/convert This new file is equivalent to `pytorch_model.bin` but safe in the sense that no arbitrary code can be put into it. These files also happen to load much faster than their pytorch counterpart: https://colab.research.google.com/github/huggingface/notebooks/blob/main/safetensors_doc/en/speed.ipynb The widgets on your model page will run using this model even if this is not merged making sure the file actually works. If you find any issues: please report here: https://huggingface.co/spaces/safetensors/convert/discussions Feel free to ignore this PR.e61cd26
-
Upload tokenizer
Verified signaturee38339e -
Upload LlamaForCausalLM
Verified signature5a94745 -
update model card README.md
db984eb -
Model save
2ce6473 -
Training in progress, step 320
a81a218 -
Training in progress, step 310
1eb523f -
Training in progress, step 300
e6e303b -
Training in progress, step 290
a3535cc -
Training in progress, step 280
8c2fd27 -
Training in progress, step 270
b4b85d7 -
Training in progress, step 260
33a1f88 -
Training in progress, step 250
d6b6537 -
Training in progress, step 240
519c080 -
Training in progress, step 230
37faa98 -
Training in progress, step 220
affb9d9 -
Training in progress, step 210
0fff6f4 -
Training in progress, step 200
e8d1858 -
Training in progress, step 190
2b7fb90 -
Training in progress, step 180
fee0106 -
Training in progress, step 170
ae359b9 -
Training in progress, step 160
5c0dccb -
Training in progress, step 150
f30de2f -
Training in progress, step 140
6fecf7f -
Training in progress, step 130
ca16b55 -
Training in progress, step 120
c916dce -
Training in progress, step 110
2b47f48 -
Training in progress, step 100
349ef87 -
Training in progress, step 90
9aa850a -
Training in progress, step 80
e1b15f0 -
Training in progress, step 70
6a8a725 -
Training in progress, step 60
949ff30 -
Training in progress, step 50
ebc71f0 -
Training in progress, step 40
3b9a3dc -
Training in progress, step 30
9861bce -
Training in progress, step 20
05c2d4d -
Training in progress, step 10
cbdf5e0 -
initial commit
Verified signatureededec1