Text Generation
Transformers
PyTorch
mpt
Composer
MosaicML
llm-foundry
StreamingDatasets
custom_code
text-generation-inference
Instructions to use EchoStreet/mpt-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EchoStreet/mpt-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EchoStreet/mpt-7b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EchoStreet/mpt-7b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("EchoStreet/mpt-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EchoStreet/mpt-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EchoStreet/mpt-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EchoStreet/mpt-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EchoStreet/mpt-7b
- SGLang
How to use EchoStreet/mpt-7b 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 "EchoStreet/mpt-7b" \ --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": "EchoStreet/mpt-7b", "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 "EchoStreet/mpt-7b" \ --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": "EchoStreet/mpt-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EchoStreet/mpt-7b with Docker Model Runner:
docker model run hf.co/EchoStreet/mpt-7b
Commit History
-
Update handler.py
Increasing response token limitea8887e
-
Update handler.py
removing increased token limit4d62adf -
Update handler.py
increasing token limit5ee8ed9 -
Update handler.py
pushing model to cuda:0e234444 -
Update handler.py
Trying stack overflow fix2c50b69 -
Update handler.py
Removing load in 8-bit flagf9a0290 -
Update handler.py
Trying 8-bit09d8478 -
Update handler.py
removing torch.float32567b729 -
Update handler.py
explicitly setting dtype to torch.float3246ed7eb -
Update handler.py
Removing bfloat16 until we have access to suitable GPUe6bbd2f -
Update handler.py
Moving device assignment to pipeline call742a64f -
Update handler.py
removing deprecated dependency0975dcd -
Update handler.py
Adding configuration settings so mpt-7b uses the GPU on our instance endpoint8bab771
-
Update handler.py
Adding trust_remote_code flag to handler.py for inference endpoint591fe66 -
Update handler.py
testing commite0f83a4 -
create handler.py
dupe custom handler from philschmid/gpt-j-6B-fp16-sharded6566cee