Instructions to use togethercomputer/GPT-NeoXT-Chat-Base-20B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use togethercomputer/GPT-NeoXT-Chat-Base-20B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="togethercomputer/GPT-NeoXT-Chat-Base-20B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("togethercomputer/GPT-NeoXT-Chat-Base-20B") model = AutoModelForCausalLM.from_pretrained("togethercomputer/GPT-NeoXT-Chat-Base-20B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use togethercomputer/GPT-NeoXT-Chat-Base-20B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "togethercomputer/GPT-NeoXT-Chat-Base-20B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "togethercomputer/GPT-NeoXT-Chat-Base-20B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/togethercomputer/GPT-NeoXT-Chat-Base-20B
- SGLang
How to use togethercomputer/GPT-NeoXT-Chat-Base-20B 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 "togethercomputer/GPT-NeoXT-Chat-Base-20B" \ --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": "togethercomputer/GPT-NeoXT-Chat-Base-20B", "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 "togethercomputer/GPT-NeoXT-Chat-Base-20B" \ --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": "togethercomputer/GPT-NeoXT-Chat-Base-20B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use togethercomputer/GPT-NeoXT-Chat-Base-20B with Docker Model Runner:
docker model run hf.co/togethercomputer/GPT-NeoXT-Chat-Base-20B
How to resolve the 'importlib.metadata.PackageNotFoundError: bitsandbytes' error after running 'pip install bitsandbytes-cuda117' in Ubuntu?
#13
by DaveBowman - opened
Greetings, I am trying to install a model on Ubuntu 20.04 on wsl2 (Cuda version 11.7 installed), but I ran into a problem.
I'm trying to run the code from here: https://huggingface.co/togethercomputer/GPT-NeoXT-Chat-Base-20B#gpu-inference-in-int8, but an error occurs when I try to run it:
Traceback (most recent call last):
File "./GPT-NeoXT-Chat-Base-20B.py", line 4, in <module>
model = AutoModelForCausalLM.from_pretrained("togethercomputer/GPT-NeoXT-Chat-Base-20B", device_map="auto", load_in_8bit=True)
File "/home/dave/.local/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 467, in from_pretrained
return model_class.from_pretrained(
File "/home/dave/.local/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2159, in from_pretrained
is_8bit_serializable = version.parse(importlib_metadata.version("bitsandbytes")) > version.parse("0.37.2")
File "/usr/lib/python3.8/importlib/metadata.py", line 530, in version
return distribution(distribution_name).version
File "/usr/lib/python3.8/importlib/metadata.py", line 503, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: bitsandbytes
Even though I have installed the bitsanbytes library:
pip install bitsandbytes-cuda117
Please tell me what to do in this situation.