Instructions to use DanielClough/Candle_Mistral-7B-Instruct-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DanielClough/Candle_Mistral-7B-Instruct-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DanielClough/Candle_Mistral-7B-Instruct-v0.1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DanielClough/Candle_Mistral-7B-Instruct-v0.1") model = AutoModelForCausalLM.from_pretrained("DanielClough/Candle_Mistral-7B-Instruct-v0.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DanielClough/Candle_Mistral-7B-Instruct-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DanielClough/Candle_Mistral-7B-Instruct-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DanielClough/Candle_Mistral-7B-Instruct-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DanielClough/Candle_Mistral-7B-Instruct-v0.1
- SGLang
How to use DanielClough/Candle_Mistral-7B-Instruct-v0.1 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 "DanielClough/Candle_Mistral-7B-Instruct-v0.1" \ --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": "DanielClough/Candle_Mistral-7B-Instruct-v0.1", "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 "DanielClough/Candle_Mistral-7B-Instruct-v0.1" \ --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": "DanielClough/Candle_Mistral-7B-Instruct-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DanielClough/Candle_Mistral-7B-Instruct-v0.1 with Docker Model Runner:
docker model run hf.co/DanielClough/Candle_Mistral-7B-Instruct-v0.1
Ubuntu commited on
Commit ·
a7395e4
1
Parent(s): d1625c3
init
Browse files- .gitattributes +1 -0
- Candle_Mistral-7B-Instruct-v0.1_q6k.gguf +3 -0
- README.md +1 -0
- convert.py +9 -0
- pytorch_model-00001-of-00002.safetensors +3 -0
- pytorch_model-00002-of-00002.safetensors +3 -0
- tokenizer.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.gguf filter=lfs diff=lfs merge=lfs -text
|
Candle_Mistral-7B-Instruct-v0.1_q6k.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d87fee84db5eebf64442aa9f444d09bcdf348cdd0279a8281120679e2eb59c7
|
| 3 |
+
size 5941352160
|
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
Refer to the main [model card](https://huggingface.co/mistralai/Mistral-Instruct-v0.1), this repo holds a simple safetensor conversion of the weights.
|
convert.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from safetensors import safe_open
|
| 3 |
+
from safetensors.torch import save_file
|
| 4 |
+
|
| 5 |
+
for d in [1, 2]:
|
| 6 |
+
print(d)
|
| 7 |
+
model = torch.load(f"pytorch_model-0000{d}-of-00002.bin")
|
| 8 |
+
print("loaded", d, len(model))
|
| 9 |
+
save_file(model, f"pytorch_model-0000{d}-of-00002.safetensors")
|
pytorch_model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f58a0dca12a9097b0e52b11cd44f135c72bdb7bc16d3a65afbc1c2d52f64621a
|
| 3 |
+
size 9942981664
|
pytorch_model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0acba30464cea439eb90f5f2f60810babe1d3fc58fbcae5ef3b9ed8b4ba81a3
|
| 3 |
+
size 4540516312
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|