Instructions to use themathys/mistralai-Code-Instruct-Finetune-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use themathys/mistralai-Code-Instruct-Finetune-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="themathys/mistralai-Code-Instruct-Finetune-test") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("themathys/mistralai-Code-Instruct-Finetune-test") model = AutoModelForCausalLM.from_pretrained("themathys/mistralai-Code-Instruct-Finetune-test") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use themathys/mistralai-Code-Instruct-Finetune-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "themathys/mistralai-Code-Instruct-Finetune-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "themathys/mistralai-Code-Instruct-Finetune-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/themathys/mistralai-Code-Instruct-Finetune-test
- SGLang
How to use themathys/mistralai-Code-Instruct-Finetune-test 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 "themathys/mistralai-Code-Instruct-Finetune-test" \ --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": "themathys/mistralai-Code-Instruct-Finetune-test", "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 "themathys/mistralai-Code-Instruct-Finetune-test" \ --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": "themathys/mistralai-Code-Instruct-Finetune-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use themathys/mistralai-Code-Instruct-Finetune-test with Docker Model Runner:
docker model run hf.co/themathys/mistralai-Code-Instruct-Finetune-test
Upload MistralForCausalLM
Browse files
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "mistralai/Mistral-7B-Instruct-v0.
|
| 3 |
"architectures": [
|
| 4 |
"MistralForCausalLM"
|
| 5 |
],
|
|
@@ -22,5 +22,5 @@
|
|
| 22 |
"torch_dtype": "float16",
|
| 23 |
"transformers_version": "4.42.0.dev0",
|
| 24 |
"use_cache": true,
|
| 25 |
-
"vocab_size":
|
| 26 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "mistralai/Mistral-7B-Instruct-v0.3",
|
| 3 |
"architectures": [
|
| 4 |
"MistralForCausalLM"
|
| 5 |
],
|
|
|
|
| 22 |
"torch_dtype": "float16",
|
| 23 |
"transformers_version": "4.42.0.dev0",
|
| 24 |
"use_cache": true,
|
| 25 |
+
"vocab_size": 32768
|
| 26 |
}
|
model-00001-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d210dc4055555a578948e0b0860a50e4073bd244d337d9309976379d5bfa5a4b
|
| 3 |
+
size 4798371448
|
model-00002-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4831925544
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd155bc3d7a37e3834f1157d559988971326a0a66b38b45cb33a09788865d00b
|
| 3 |
size 4831925544
|
model-00003-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4999714832
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44cf80ba7e3bbb609dde6e3243a93743755c5f422aaadc9213b2cebdc17b0326
|
| 3 |
size 4999714832
|
model-00004-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4999714832
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ede45c0e5ad93be3679fd2ba2c028dae5bb239ec6ac95ecbd3b7b3444e7706b4
|
| 3 |
size 4999714832
|
model-00005-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4831925592
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0279f8089a62693c456bd37f26e859cd6ec97c2c2af58ac902a3cc2f5046368
|
| 3 |
size 4831925592
|
model-00006-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5305eaab969223fb3da2330b90b753467627cced987e7a6987a5db77c3c40c48
|
| 3 |
+
size 3993072240
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00006-of-00006.safetensors",
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 28454690816
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00006-of-00006.safetensors",
|