Text Generation
Transformers
PyTorch
English
mistral
Generated from Trainer
inferentia2
neuron
conversational
text-generation-inference
Instructions to use aws-neuron/zephyr-7b-beta-neuron with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aws-neuron/zephyr-7b-beta-neuron with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aws-neuron/zephyr-7b-beta-neuron") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aws-neuron/zephyr-7b-beta-neuron") model = AutoModelForCausalLM.from_pretrained("aws-neuron/zephyr-7b-beta-neuron") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use aws-neuron/zephyr-7b-beta-neuron with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aws-neuron/zephyr-7b-beta-neuron" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aws-neuron/zephyr-7b-beta-neuron", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aws-neuron/zephyr-7b-beta-neuron
- SGLang
How to use aws-neuron/zephyr-7b-beta-neuron 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/zephyr-7b-beta-neuron" \ --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": "aws-neuron/zephyr-7b-beta-neuron", "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 "aws-neuron/zephyr-7b-beta-neuron" \ --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": "aws-neuron/zephyr-7b-beta-neuron", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aws-neuron/zephyr-7b-beta-neuron with Docker Model Runner:
docker model run hf.co/aws-neuron/zephyr-7b-beta-neuron
Upload folder using huggingface_hub
Browse files- .gitattributes +4 -0
- 0e72957392b3a5897c20.neff +3 -0
- 188bb34b13539c76dd99.neff +3 -0
- 97cfc2d8d6c59d12a28f.neff +3 -0
- cd15a292fcfa32df7f51.neff +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
0e72957392b3a5897c20.neff filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
188bb34b13539c76dd99.neff filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
97cfc2d8d6c59d12a28f.neff filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
cd15a292fcfa32df7f51.neff filter=lfs diff=lfs merge=lfs -text
|
0e72957392b3a5897c20.neff
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a43f66581981889380aa17560e7ad564893923bcd12d14ac05e6305d8daff33
|
| 3 |
+
size 9688064
|
188bb34b13539c76dd99.neff
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be50474fb6445de02bc8c12f91d15de4b631d4d6ea6c5656ebfb15883e7540bf
|
| 3 |
+
size 8592384
|
97cfc2d8d6c59d12a28f.neff
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7599529303f31a251be6c7a4f734dfe54d5b3545f736d33e551b91f77c90714
|
| 3 |
+
size 8530944
|
cd15a292fcfa32df7f51.neff
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b945400596de9d5f5d570ef4a3d2d3ed7e63b38cfca339e0ae7d141ef50043ec
|
| 3 |
+
size 9073664
|