Text Generation
Transformers
PyTorch
mistral
openchat
C-RLFT
conversational
text-generation-inference
Instructions to use openchat/openchat_3.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openchat/openchat_3.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openchat/openchat_3.5") 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("openchat/openchat_3.5") model = AutoModelForCausalLM.from_pretrained("openchat/openchat_3.5", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openchat/openchat_3.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openchat/openchat_3.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openchat/openchat_3.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openchat/openchat_3.5
- SGLang
How to use openchat/openchat_3.5 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 "openchat/openchat_3.5" \ --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": "openchat/openchat_3.5", "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 "openchat/openchat_3.5" \ --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": "openchat/openchat_3.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openchat/openchat_3.5 with Docker Model Runner:
docker model run hf.co/openchat/openchat_3.5
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.94a80f2
-
Update README.md
Verified signature0fc98e3
-
Update README.md
Verified signaturec8ac815
-
Update README.md
e4d87b9
-
Update README.md
99d59d4
-
Update README.md
2b2dbf0 -
Update README.md
effe26a
-
Update README.md
75a0c61
-
Update README.md
7e65595
-
Add chat template (#27)
- Update README (75452cee6bfeadf3595db327ad642f058c3264f0) - Add chat template (69a339b1e8b0bad0db1bb714bfdb851854a3fff8)a11af6b
-
Create generation_config.json (#21)
- Create generation_config.json (6630da04b1fca217767bbec423f22f10b684d735) Co-authored-by: fenglui <fenglui@users.noreply.huggingface.co>5b874a3
-
Update README.md
600a344
-
Update model card metadata
2d39b2e
-
Update dataset details in model card (#11)
- Update dataset details in model card (18814554d4eae9ac565b627f11442871fb2c933f)37ca7ce
-
Update README.md
0be788e -
Update README.md
b6c8863 -
Update README.md
5563fa7 -
Update README.md
17ccd19
-
Update README.md
eebadee -
Add baselines
6814591
-
Update README.md
4d04f08 -
Update README.md
3618d9b -
EOS should be 32000 (#4)
- EOS should be 32000 (60554874db2927237b558c23a990eb20af8dc592) Co-authored-by: Tom Jobbins <TheBloke@users.noreply.huggingface.co>d4024c4 -
EOS should be 32000 (#3)
- EOS should be 32000 (a74ef171432c307c8c5f3da002536d184e815269) Co-authored-by: Tom Jobbins <TheBloke@users.noreply.huggingface.co>394df69
-
[doc] update README
f85ea3d -
Update model card
17083ef
-
Add fast tokenizer support
81689a2
-
bf16
0ba9dfe -
fp16
1387ce5 -
weights
1025f2b -
initial commit
f897c6b