Instructions to use Writer/camel-5b-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Writer/camel-5b-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Writer/camel-5b-hf")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Writer/camel-5b-hf") model = AutoModelForCausalLM.from_pretrained("Writer/camel-5b-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Writer/camel-5b-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Writer/camel-5b-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Writer/camel-5b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Writer/camel-5b-hf
- SGLang
How to use Writer/camel-5b-hf 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 "Writer/camel-5b-hf" \ --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": "Writer/camel-5b-hf", "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 "Writer/camel-5b-hf" \ --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": "Writer/camel-5b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Writer/camel-5b-hf with Docker Model Runner:
docker model run hf.co/Writer/camel-5b-hf
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.81109f9
-
Update README.md
d1438e2 -
update usage code
eb6cf53 -
Update README.md
191d228 -
Update README.md
988448f
-
Update README.md (#2)
- Update README.md (d87ad8fd88b7edbd13c6bb7834dd779e630e735f) Co-authored-by: Heath Robinson <heathexer@users.noreply.huggingface.co>fb2f194 -
Update README.md
420f94f -
Update README.md
aaaeba3 -
Update README.md
66444e5
-
Update README.md
c56e062 -
Update README.md
64ae727 -
Update README.md
c8e2baa -
Update README.md
c519235 -
Update README.md
18a0f7a -
Update README.md
c065c6e -
Update README.md
3601821 -
Delete Camel&Llama.png
86d24fb -
Update README.md
64e0451 -
Update README.md
8d0bc4d -
Update README.md
25680e9 -
Upload Camel&Llama.png
ccf199a -
Update README.md
daa406c -
Update README.md
4c9422d -
Update README.md
2d2b6a8 -
Update README.md
ea9e87e -
Update README.md
e338cb0 -
Create requirements.txt (#1)
- Create requirements.txt (774e02dfae5a918486d2c47f8d6c5fba0fdb3d77) Co-authored-by: Nicholas Broad <nbroad@users.noreply.huggingface.co>0a47f3a
-
Update config.json
6f93c92
-
Update README.md
9aa3d34 -
Update handler.py
41a22ce -
Update README.md
c59532d -
add example usage
e2c44ff -
Create handler.py
1f13fde -
add model files
7322964 -
initial commit
a858739