Instructions to use Salesforce/xgen-7b-8k-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/xgen-7b-8k-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Salesforce/xgen-7b-8k-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Salesforce/xgen-7b-8k-base") model = AutoModelForCausalLM.from_pretrained("Salesforce/xgen-7b-8k-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Salesforce/xgen-7b-8k-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Salesforce/xgen-7b-8k-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Salesforce/xgen-7b-8k-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Salesforce/xgen-7b-8k-base
- SGLang
How to use Salesforce/xgen-7b-8k-base 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 "Salesforce/xgen-7b-8k-base" \ --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": "Salesforce/xgen-7b-8k-base", "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 "Salesforce/xgen-7b-8k-base" \ --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": "Salesforce/xgen-7b-8k-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Salesforce/xgen-7b-8k-base with Docker Model Runner:
docker model run hf.co/Salesforce/xgen-7b-8k-base
Adding `safetensors` variant of this model
#34 opened over 1 year ago
by
SFconvertbot
AttributeError: add_special_tokens conflicts with the method add_special_tokens in XgenTokenizer
👀 1
2
#33 opened over 1 year ago
by
Avici786
fix tokenizer save_pretrained method
🔥 2
#32 opened almost 2 years ago
by
katuni4ka
Adding `safetensors` variant of this model
#31 opened about 2 years ago
by
SFconvertbot
xgen-7b-8k-base model tokenizer has a problem: AttributeError: 'XgenTokenizer' object has no attribute 'encoder'
3
#29 opened over 2 years ago
by
awesomenes
Issue if you try to resize position embeddings
#26 opened almost 3 years ago
by
njbrake
tokenization mismatch
#25 opened almost 3 years ago
by
ehartford
fine tune the model for custom dataset
👍 2
5
#24 opened almost 3 years ago
by
NajiAboo
Regarding Choosing TPU over GPU for training
1
#23 opened almost 3 years ago
by
eshamanideep
Error using Chroma from langchain.vectorstores with the model.
#22 opened almost 3 years ago
by
rb17
tokenizer.get_vocab() method is not working
2
#17 opened almost 3 years ago
by
Zangs3011
How to prompt the model properly?
#16 opened almost 3 years ago
by
viktor-ferenczi
"no entry found for key" Error
2
#15 opened almost 3 years ago
by
mber
Error loading model into Test Generation Web UI (ooba)
8
#11 opened almost 3 years ago
by
viktor-ferenczi
Add language information to model metadata
#10 opened almost 3 years ago
by
davanstrien
hardware requirements
👍 3
#9 opened almost 3 years ago
by
kalinasviatoslav
Find supported model_kwargs
#3 opened almost 3 years ago
by
gdcoder