Text Generation
Transformers
PyTorch
Safetensors
mpt
MosaicML
AWQ
custom_code
text-generation-inference
Instructions to use abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq
- SGLang
How to use abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq 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 "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq" \ --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": "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", "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 "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq" \ --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": "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq with Docker Model Runner:
docker model run hf.co/abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq
Abhinav Kulkarni commited on
Commit ·
24a5819
1
Parent(s): 1c78c94
Updated README
Browse files
README.md
CHANGED
|
@@ -51,7 +51,10 @@ model_name = "abhinavkulkarni/mosaicml-mpt-30b-chat-w4-g128-awq"
|
|
| 51 |
config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
|
| 52 |
|
| 53 |
# Tokenizer
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
| 55 |
streamer = TextStreamer(tokenizer, skip_special_tokens=True)
|
| 56 |
|
| 57 |
# Model
|
|
|
|
| 51 |
config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
|
| 52 |
|
| 53 |
# Tokenizer
|
| 54 |
+
try:
|
| 55 |
+
tokenizer = AutoTokenizer.from_pretrained(config.tokenizer_name, trust_remote_code=True)
|
| 56 |
+
except:
|
| 57 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False, trust_remote_code=True)
|
| 58 |
streamer = TextStreamer(tokenizer, skip_special_tokens=True)
|
| 59 |
|
| 60 |
# Model
|