Instructions to use mikecovlee/tinymixtral with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mikecovlee/tinymixtral with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mikecovlee/tinymixtral", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mikecovlee/tinymixtral", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mikecovlee/tinymixtral with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mikecovlee/tinymixtral" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mikecovlee/tinymixtral", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mikecovlee/tinymixtral
- SGLang
How to use mikecovlee/tinymixtral 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 "mikecovlee/tinymixtral" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mikecovlee/tinymixtral", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mikecovlee/tinymixtral" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mikecovlee/tinymixtral", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mikecovlee/tinymixtral with Docker Model Runner:
docker model run hf.co/mikecovlee/tinymixtral
Upload post-trained checkpoint
Browse files- modeling_tinymixtral.py +1 -1
- pytorch_model.bin +1 -1
modeling_tinymixtral.py
CHANGED
|
@@ -230,7 +230,7 @@ class TinyMixtralForCausalLM(PreTrainedModel):
|
|
| 230 |
labels.reshape(-1),
|
| 231 |
ignore_index=-100,
|
| 232 |
)
|
| 233 |
-
loss = loss + self.config.router_aux_loss_coef * total_aux
|
| 234 |
|
| 235 |
if not return_dict:
|
| 236 |
return (loss, logits) if loss is not None else (logits,)
|
|
|
|
| 230 |
labels.reshape(-1),
|
| 231 |
ignore_index=-100,
|
| 232 |
)
|
| 233 |
+
loss = loss + self.config.router_aux_loss_coef * (total_aux / len(self.layers))
|
| 234 |
|
| 235 |
if not return_dict:
|
| 236 |
return (loss, logits) if loss is not None else (logits,)
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1729603131
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f0593c48a833544b0dbeec1381e73c1e484fef75be688aee724e124dd200a74
|
| 3 |
size 1729603131
|