Instructions to use VMware/xgen-7b-8k-open-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VMware/xgen-7b-8k-open-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VMware/xgen-7b-8k-open-instruct")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VMware/xgen-7b-8k-open-instruct") model = AutoModelForCausalLM.from_pretrained("VMware/xgen-7b-8k-open-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VMware/xgen-7b-8k-open-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VMware/xgen-7b-8k-open-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VMware/xgen-7b-8k-open-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/VMware/xgen-7b-8k-open-instruct
- SGLang
How to use VMware/xgen-7b-8k-open-instruct 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 "VMware/xgen-7b-8k-open-instruct" \ --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": "VMware/xgen-7b-8k-open-instruct", "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 "VMware/xgen-7b-8k-open-instruct" \ --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": "VMware/xgen-7b-8k-open-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use VMware/xgen-7b-8k-open-instruct with Docker Model Runner:
docker model run hf.co/VMware/xgen-7b-8k-open-instruct
Commit History
-
Adding `safetensors` variant of this model (#2)
Verified signature- Adding `safetensors` variant of this model (44d0b589d01ce180cd8d25a28e3a26756d05398b) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>2afb9d2
-
Update README.md
15b763c
-
Update README.md
b093c27
-
Update README.md
fea26e5
-
Update README.md
480b107 -
Update tokenizer_config.json
5150184 -
Create tokenization_xgen.py
085f757 -
Update README.md
06073ac -
Update README.md
fb0b223 -
Update README.md
714c19e
-
Update README.md
a54e47e -
Update README.md
5a9d58d -
Create README.md
38621ba -
Upload tokenizer
778d9ed -
Upload LlamaForCausalLM
b5bf5ba -
initial commit
9b5a64f