Instructions to use MoxoffAdmin/Mistral-Ita with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoxoffAdmin/Mistral-Ita with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MoxoffAdmin/Mistral-Ita")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MoxoffAdmin/Mistral-Ita") model = AutoModelForCausalLM.from_pretrained("MoxoffAdmin/Mistral-Ita") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MoxoffAdmin/Mistral-Ita with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MoxoffAdmin/Mistral-Ita" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoxoffAdmin/Mistral-Ita", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MoxoffAdmin/Mistral-Ita
- SGLang
How to use MoxoffAdmin/Mistral-Ita 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 "MoxoffAdmin/Mistral-Ita" \ --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": "MoxoffAdmin/Mistral-Ita", "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 "MoxoffAdmin/Mistral-Ita" \ --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": "MoxoffAdmin/Mistral-Ita", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MoxoffAdmin/Mistral-Ita with Docker Model Runner:
docker model run hf.co/MoxoffAdmin/Mistral-Ita
Unique Features for Italian
- Tailored Vocabulary: The model's vocabulary is fine-tuned to encompass the nuances and diversity of the Italian language.
- Enhanced Understanding: Mistral-7B is specifically trained to grasp and generate Italian text, ensuring high linguistic and contextual accuracy.
4-Bit Quantized Model Download
The model quantized to 4 bits is available for download at this link: mistal-Ita-4bit.gguf
How to Use
How to utilize my Mistral for Italian text generation
import transformers
from transformers import TextStreamer
import torch
model_name = "Moxoff/Mistral-Ita"
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
model = transformers.LlamaForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto").eval()
def stream(user_prompt):
runtimeFlag = "cuda:0"
system_prompt = ''
B_INST, E_INST = "[INST]", "[/INST]"
prompt = f"{system_prompt}{B_INST}{user_prompt.strip()}\n{E_INST}"
inputs = tokenizer([prompt], return_tensors="pt").to(runtimeFlag)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=100, num_return_sequences=1)
domanda = """Scrivi una funzione python che calcola la media di questi numeri"""
contesto = """
[-5, 10, 15, 20, 25, 30, 35]
"""
prompt = domanda + "\n" + contesto
stream(prompt)
- Downloads last month
- -