Instructions to use SpectraSuite/TriLM_3.9B_Unpacked with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SpectraSuite/TriLM_3.9B_Unpacked with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SpectraSuite/TriLM_3.9B_Unpacked")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SpectraSuite/TriLM_3.9B_Unpacked") model = AutoModelForCausalLM.from_pretrained("SpectraSuite/TriLM_3.9B_Unpacked") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SpectraSuite/TriLM_3.9B_Unpacked with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SpectraSuite/TriLM_3.9B_Unpacked" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SpectraSuite/TriLM_3.9B_Unpacked", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SpectraSuite/TriLM_3.9B_Unpacked
- SGLang
How to use SpectraSuite/TriLM_3.9B_Unpacked 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 "SpectraSuite/TriLM_3.9B_Unpacked" \ --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": "SpectraSuite/TriLM_3.9B_Unpacked", "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 "SpectraSuite/TriLM_3.9B_Unpacked" \ --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": "SpectraSuite/TriLM_3.9B_Unpacked", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SpectraSuite/TriLM_3.9B_Unpacked with Docker Model Runner:
docker model run hf.co/SpectraSuite/TriLM_3.9B_Unpacked
Update README.md
#1
by hgabor47 - opened
README.md
CHANGED
|
@@ -11,7 +11,7 @@ import transformers as tf, torch
|
|
| 11 |
model_name = "SpectraSuite/TriLM_3.9B_Unpacked"
|
| 12 |
|
| 13 |
# Please adjust the temperature, repetition penalty, top_k, top_p and other sampling parameters according to your needs.
|
| 14 |
-
pipeline = tf.pipeline("text-generation", model=
|
| 15 |
|
| 16 |
# These are base (pretrained) LLMs that are not instruction and chat tuned. You may need to adjust your prompt accordingly.
|
| 17 |
pipeline("Once upon a time")
|
|
|
|
| 11 |
model_name = "SpectraSuite/TriLM_3.9B_Unpacked"
|
| 12 |
|
| 13 |
# Please adjust the temperature, repetition penalty, top_k, top_p and other sampling parameters according to your needs.
|
| 14 |
+
pipeline = tf.pipeline("text-generation", model=model_name, model_kwargs={"torch_dtype": torch.float16}, device_map="auto")
|
| 15 |
|
| 16 |
# These are base (pretrained) LLMs that are not instruction and chat tuned. You may need to adjust your prompt accordingly.
|
| 17 |
pipeline("Once upon a time")
|