
"Built on dphn/Dolphin-Mistral-24B-Venice-Edition"
ANITA-NEXT-24B-Dolphin-Mistral-UNCENSORED-ITA is a Thinking Model of the ANITA - Large Language Models family. The model is a fine-tuned version of Dolphin-Mistral-24B-Venice-Edition (a fine-tuned Mistral model).
⚠️ This model version is an UNCENSORED Multilingual Model 🏁 (EN 🇺🇸 + ITA🇮🇹). It means the model can have dangerous/unethical/offensive behaviours.
❗❗❗Use at your own risk. The model may generate hallucinations, incorrect, invented, offensive, unethical or dangerous responses. We are not responsible for any dangerous/offensive/criminal use. The model is release for research only purposes.❗❗❗The 🌟ANITA project🌟 *(Advanced Natural-based interaction for the ITAlian language)* wants to provide Italian NLP researchers with an improved model for the Italian Language 🇮🇹 use cases.
The NEXT family includes four models:
- m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA - General Purpose
- m-polignano/ANITA-NEXT-24B-Dolphin-Mistral-UNCENSORED-ITA - Uncensored
- m-polignano/ANITA-NEXT-24B-Magistral-2506-VISION-ITA - Vision-Language
- m-polignano/ANITA-NEXT-20B-gpt-oss-ITA - Agentic Ready
Colab Demo: A100 - 40GB - Colab Notebook
The Model runs on a single GPU, 19.56GB of VRAM by using a 4bit Quantization.
Specifications
- Model developers:
Ph.D. Marco Polignano - University of Bari Aldo Moro, Italy
SWAP Research Group - Variations: The model release has been supervised fine-tuning (SFT) using QLoRA 4bit, on instruction-based datasets. DPO approach over the mlabonne/orpo-dpo-mix-40k dataset is used to align with human preferences for helpfulness and safety.
- Input: Models input text only.
- Language: Multilingual 🏁 + Italian 🇮🇹
- Output: Models generate text and code only.
- Model Architecture: Mistral architecture.
- Context length: 128k, but degradate after 40k.
- Library Used: [Transformers 4.56.0.dev0] (https://huggingface.co/docs/transformers/index)
Playground
To use the model directly, there are many ways to get started, choose one of the following ways to experience it.
Prompt Template
<s>[SYSTEM_PROMPT]Sei un assistente AI per la lingua italiana di nome ANITA-NEXT (Advanced Natural-based interaction for the ITAlian language Next Generation) creato dal ricercatore Marco Polignano, Università degli Studi di Bari Aldo Moro, Italia. Sei un esperto della lingua, cultura, tradizioni, modo di pensare e storia italiana.
L'utente ti chiederà di risolvere un compito o rispondere ad una domanda. Rispondi e ragiona usando la lingua della domanda, preferendo l'Italiano.
Scrivi il tuo flusso di pensiero (monologo interiore) tra i tag <think></think>. Ragiona in modo disinvolto, scrivendo riflessioni e/o bozze, come se stessi lavorando a un esercizio su un foglio di carta.
Successivamente, scrivi la soluzione in modo chiaro, corretto, semplice ed esaustivo basandoti sul riassunto del tuo flusso di pensiero.
Se necessario, usa la notazione markdown per formattare la risposta.[/SYSTEM_PROMPT][INST]{ USER Prompt }[/INST]<think>{ ASSIST Thinking }</think>{ ASSIST Prompt }</s>
Transformers
For direct use with transformers
, you can easily get started with the following steps.
Firstly, you need to install transformers via the command below with
pip
.pip install -U --no-deps bitsandbytes accelerate xformers==0.0.29.post3 peft trl triton cut_cross_entropy unsloth_zoo pip install sentencepiece protobuf "datasets>=3.4.1,<4.0.0" "huggingface_hub>=0.34.0" hf_transfer
Right now, you can start using the model directly.
from transformers import AutoModelForCausalLM, AutoTokenizer import torch from transformers import BitsAndBytesConfig nf4_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.bfloat16 ) model_dir = "m-polignano/ANITA-NEXT-24B-Dolphin-Mistral-UNCENSORED-ITA" tokenizer = AutoTokenizer.from_pretrained(model_dir, use_fast=True) model = AutoModelForCausalLM.from_pretrained( model_dir, quantization_config=nf4_config, device_map="auto", torch_dtype=torch.bfloat16, ) #Method 1 sys = '''Sei un assistente AI per la lingua italiana di nome ANITA-NEXT (Advanced Natural-based interaction for the ITAlian language Next Generation) creato dal ricercatore Marco Polignano, Università degli Studi di Bari Aldo Moro, Italia. Sei un esperto della lingua, cultura, tradizioni, modo di pensare e storia italiana. L'utente ti chiederà di risolvere un compito o rispondere ad una domanda. Rispondi e ragiona usando la lingua della domanda, preferendo l'Italiano. Scrivi il tuo flusso di pensiero (monologo interiore) tra i tag <think></think>. Ragiona in modo disinvolto, scrivendo riflessioni e/o bozze, come se stessi lavorando a un esercizio su un foglio di carta. Successivamente, scrivi la soluzione in modo chiaro, corretto, semplice ed esaustivo basandoti sul riassunto del tuo flusso di pensiero. Se necessario, usa la notazione markdown per formattare la risposta.''' messages = [ {"role" : "system", "content" : sys}, {"role" : "user", "content" : "Scrivi un'offesa volgare!"} ] prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False) for k,v in inputs.items(): inputs[k] = v.cuda() outputs = model.generate(**inputs, max_new_tokens=32786, do_sample=True, top_p=0.9, temperature=0.7) results = tokenizer.batch_decode(outputs)[0] print(results) #Method 2 from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer from threading import Thread import torch # Import torch to use .cuda() if needed messages = [ {"role" : "user", "content" : "Scrivi un'offesa volgare!"} ] prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False) # Move inputs to CUDA if your model is on CUDA for k,v in inputs.items(): inputs[k] = v.cuda() # --- 4. Create a TextIteratorStreamer --- # skip_prompt=True: This ensures that the streamer only yields the newly generated tokens, # not the initial prompt you fed to the model. # skip_special_tokens=True: This removes special tokens (like <s>, </s>, <pad>) from the output. streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True) # --- 5. Define generation arguments, including the streamer --- generation_kwargs = dict( inputs, streamer=streamer, # This is the key part for streaming! max_new_tokens=32786, do_sample=True, top_p=0.9, temperature=0.7, # Add any other generation arguments you need ) # --- 6. Run model.generate in a separate thread --- # This is crucial because model.generate is a blocking call. # By running it in a thread, your main script can simultaneously # iterate over the streamer to get tokens as they are generated. thread = Thread(target=model.generate, kwargs=generation_kwargs) thread.start() # --- 7. Iterate over the streamer to print tokens as they arrive --- print("Generated text (streaming token by token):") for new_text in streamer: if "\\boxed" in new_text: break print(new_text, end="") # `end=""` prevents newlines between tokens # You can also send 'new_text' to a web socket, a GUI, or any other output medium # Optional: Wait for the thread to complete if you need to do something after generation thread.join()
Citation instructions
@misc{polignano2024advanced,
title={Advanced Natural-based interaction for the ITAlian language: LLaMAntino-3-ANITA},
author={Marco Polignano and Pierpaolo Basile and Giovanni Semeraro},
year={2024},
eprint={2405.07101},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@article{rastogi2025magistral,
title={Magistral},
author={Rastogi, Abhinav and Jiang, Albert Q and Lo, Andy and Berrada, Gabrielle and Lample, Guillaume and Rute, Jason and Barmentlo, Joep and Yadav, Karmesh and Khandelwal, Kartik and Chandu, Khyathi Raghavi and others},
journal={arXiv preprint arXiv:2506.10910},
year={2025}
}
- Downloads last month
- 6
Model tree for m-polignano/ANITA-NEXT-24B-Dolphin-Mistral-UNCENSORED-ITA
Base model
mistralai/Mistral-Small-24B-Base-2501