Run this model with HF Jobs
Run SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct") model = AutoModelForCausalLM.from_pretrained("SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct
- SGLang
How to use SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct 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 "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct" \ --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": "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct", "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 "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct" \ --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": "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct with Docker Model Runner:
docker model run hf.co/SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct
Update README.md
Browse files39 unmodified lines40414243434445464748495051525354555 unmodified lines6162635564656667575868697071727374757677787980818283848586878889909192936194959697989910010110210310410539 unmodified lines
## Evaluation
...Adapted models are evaluated on [ITA-Bench])(https://github.com/SapienzaNLP/ita-bench).
| Model | MMLU (5-shots) | ARC-C (5-shots) | Hellaswag (0-shots) | IFEval (inst_level) ||------|-----|------|------|------|| Llama-3.1-SAVA | 56.9 | 42.3 | 58.1 | 62.3 || Llama-3.1-LAPT | 58.5 | 47.9 | 62.4 | 67.3 || Mistral-0.1-SAVA | 51.5 | 41.6 | 57.5 | 61.7 || **Mistral-0.1-LAPT** | 52.9 | 39.9 | 58.4 | 60.0 || Llama-3.1-Original | 47.4 | 43.1 | 57.9 | 66.8 || Mistral-0.1-Original | 41.6 | 38.9 | 50.0 | 42.2 |
## Use with Transformers
5 unmodified linesimport transformersimport torch
model_id = "SemanticAlignment/Mistral-v0.1-Italian-FVT-instruct"model_id = "SemanticAlignment/Mistral-v0.1-Italian-LAPT-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
pipeline = transformers.pipeline( "text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map="auto"generator = pipeline( "text-generation", model=model_name, device_map="auto", dtype=torch.bfloat16)
conversations.append([ {"role": "system", "content": "Sei un assistente utile, rispondi in modo conciso e coerente."}, {"role": "user", "content": "Cosa si può fare in una bella giornata di sole?"},])
chat_samples = tokenizer.apply_chat_template(conversations, tokenize=False)
# get number of prompt tokensprompt_tokens_number = len(tokenizer(chat_samples)["input_ids"])
outputs = generator( conversations, max_new_tokens=2048, eos_token_id=[ tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<|eot_id|>"), ],)
pipeline("Cosa si può fare in una bella giornata di sole?")```
Code: https://github.com/SapienzaNLP/sava
## AknowledgementThanks to Leonardo Colosi (colosi@diag.uniroma1.it) for helping in instruction tuning phase.
We acknowledge ISCRA for awarding this project access to the LEONARDO supercomputer, owned by the EuroHPC Joint Undertaking, hosted by CINECA (Italy).
## Citation
If you use any part of this work, please consider citing the paper as follows:README.md+42-5