初始化项目,由ModelHub XC社区提供模型

Model: Mattimax/DACMini-IT
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-27 22:04:38 +08:00
commit 3263f9040a
21 changed files with 358190 additions and 0 deletions

35
.gitattributes vendored Normal file
View File

@@ -0,0 +1,35 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

278
README.md Normal file
View File

@@ -0,0 +1,278 @@
---
license: mit
datasets:
- Mattimax/DATA-AI_Conversation_ITA
language:
- it
base_model:
- Mattimax/DACMini
library_name: transformers
tags:
- DAC
- DATA-AI
- data-ai
---
[![HuggingFace](https://img.shields.io/badge/HuggingFace-Mattimax-brightgreen)](https://huggingface.co/Mattimax)
[![M.INC](https://img.shields.io/badge/M.INC-Labs-blue)](https://huggingface.co/MINC01)
## ☕ Support my research
[![Buy Me a Coffee](https://img.shields.io/badge/Support-Buy%20Me%20a%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black)](https://www.buymeacoffee.com/marzomattye)
# Mattimax/DACMini-IT
![Logo di DACMini](https://huggingface.co/Mattimax/DACMini/resolve/main/DACMini_Logo/DACMini_Logo.png)
* **Autore:** [Mattimax](https://huggingface.co/Mattimax)
* **Organizzazione:** [M.INC](https://huggingface.co/MINC01)
* **Licenza:** MIT
---
## Descrizione
**DACMini-IT** è un modello di linguaggio compatto e instruction tuned per **chat e dialogo in lingua italiana**.
Basato sullarchitettura **GPT-2 Small (italian adaptation)**, è progettato per essere rapido, leggero e facilmente distribuibile su dispositivi con risorse limitate.
Rispetto a DACMini “base”, **DACMini-IT** è addestrato su dataset italiani conversazionali strutturati in formato *user-assistant*, ottimizzando la capacità di seguire istruzioni e gestire conversazioni multi-turno naturali.
---
## Dimensioni e caratteristiche tecniche
* **Parametri:** 109M
* **Architettura:** GPT-2 Small (italian adaptation)
* **Lunghezza massima del contesto:** 512 token
* **Numero di strati:** 12
* **Numero di teste di attenzione:** 12
* **Dimensione embedding:** 768
* **Vocabolario:** ~50.000 token
* **Quantizzazione:** supportata (8-bit / 4-bit opzionale con `bitsandbytes`)
---
## Dataset di addestramento
Addestrato su [**Mattimax/DATA-AI_Conversation_ITA**](https://huggingface.co/datasets/Mattimax/DATA-AI_Conversation_ITA), un dataset italiano di dialoghi instruction tuned, contenente coppie *prompt-response* strutturate per favorire risposte coerenti, naturali e grammaticalmente corrette.
---
## Obiettivi
* Chatbot in lingua italiana con capacità di seguire istruzioni.
* Risposte concise, chiare e naturali in contesti multi-turno.
* Applicazioni leggere o offline dove la dimensione del modello è un vincolo.
---
## Avvertenze e limitazioni
* Modello **sperimentale**: può produrre errori logici o risposte non pertinenti.
* Non addestrato su temi sensibili o contenuti specialistici.
* Prestazioni limitate su conversazioni molto lunghe o prompt complessi.
* Non destinato ad usi commerciali senza ulteriore validazione.
---
## Uso consigliato
* Applicazioni chatbot leggere o offline in italiano.
* Prototipazione e test di pipeline NLP italiane.
* Generazione di risposte sintetiche e dataset per training o valutazione.
---
## Codice per inferenza di esempio
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# 1. Carica modello e tokenizer addestrati
model_path = "Mattimax/DACMini-IT"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)
model.eval()
# 2. Funzione di generazione
def chat_inference(prompt, max_new_tokens=150, temperature=0.7, top_p=0.9):
# Costruisci input nel formato usato in training
formatted_prompt = f"<|user|> {prompt.strip()} <|assistant|>"
# Tokenizza
inputs = tokenizer(formatted_prompt, return_tensors="pt")
# Genera risposta
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
temperature=temperature,
top_p=top_p,
do_sample=True,
pad_token_id=tokenizer.pad_token_id or tokenizer.eos_token_id
)
# Decodifica e rimuovi prompt iniziale
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
response = generated_text.split("<|assistant|>")[-1].strip()
return response
# 3. Esempio duso
if __name__ == "__main__":
while True:
user_input = input("👤 Utente: ")
if user_input.lower() in ["exit", "quit"]:
break
response = chat_inference(user_input)
print(f"🤖 Assistant: {response}\n")
````
## Referenze
* Dataset: [Mattimax/DATA-AI_Conversation_ITA](https://huggingface.co/datasets/Mattimax/DATA-AI_Conversation_ITA)
* Modello di base: [DACMini](https://huggingface.co/Mattimax/DACMini)
* Organizzazione: [M.INC](https://huggingface.co/MINC01)
* Collezione: [Little_DAC Collection](https://huggingface.co/collections/Mattimax/little-dac-collection-68e11d19a5949d08e672b312)
## Citazione
Se utilizzi **Mattimax/DACMini-IT** in un progetto, un articolo o qualsiasi lavoro, ti chiediamo gentilmente di citarlo usando il file `CITATION.bib` incluso nel repository:
```bibtex
@misc{mattimax2025dacminiit,
title = {{Mattimax/DACMini-IT}: Un modello di linguaggio open source},
author = {Mattimax},
howpublished = {\url{https://huggingface.co/Mattimax/DACMini-IT}},
year = {2025},
note = {License: MIT. Se usi questo modello, per favore citane la fonte originale.}
}
```
---
# English version
## Description
**DACMini-IT** is a compact, instruction-tuned language model for **Italian chat and dialogue**.
Based on the **GPT-2 Small (Italian adaptation)** architecture, it is designed to be fast, lightweight, and easily deployable on low-resource devices.
Compared to the “base” DACMini, **DACMini-IT** is trained on Italian conversational datasets structured in *user-assistant* format, optimizing its ability to follow instructions and handle natural multi-turn conversations.
---
## Size and technical specs
* **Parameters:** 109M
* **Architecture:** GPT-2 Small (Italian adaptation)
* **Max context length:** 512 tokens
* **Number of layers:** 12
* **Number of attention heads:** 12
* **Embedding size:** 768
* **Vocabulary:** ~50,000 tokens
* **Quantization:** supported (optional 8-bit / 4-bit via `bitsandbytes`)
---
## Training dataset
Trained on [**Mattimax/DATA-AI_Conversation_ITA**](https://huggingface.co/datasets/Mattimax/DATA-AI_Conversation_ITA), an Italian instruction-tuned conversational dataset containing structured *prompt-response* pairs designed to promote coherent, natural, and grammatically correct answers.
---
## Objectives
* Italian-language chatbot with instruction-following capabilities.
* Concise, clear, and natural responses in multi-turn contexts.
* Lightweight or offline applications where model size is a constraint.
---
## Warnings and limitations
* **Experimental** model: may produce logical errors or irrelevant answers.
* Not trained on sensitive topics or specialized content.
* Limited performance on very long conversations or complex prompts.
* Not intended for commercial use without further validation.
---
## Recommended use
* Lightweight or offline Italian chatbot applications.
* Prototyping and testing of Italian NLP pipelines.
* Synthetic response generation and datasets for training or evaluation.
---
## Example inference code
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# 1. Load trained model and tokenizer
model_path = "Mattimax/DACMini-IT"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path)
model.eval()
# 2. Generation function
def chat_inference(prompt, max_new_tokens=150, temperature=0.7, top_p=0.9):
# Build input in the format used during training
formatted_prompt = f"<|user|> {prompt.strip()} <|assistant|>"
# Tokenize
inputs = tokenizer(formatted_prompt, return_tensors="pt")
# Generate response
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
temperature=temperature,
top_p=top_p,
do_sample=True,
pad_token_id=tokenizer.pad_token_id or tokenizer.eos_token_id
)
# Decode and remove initial prompt
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
response = generated_text.split("<|assistant|>")[-1].strip()
return response
# 3. Usage example
if __name__ == "__main__":
while True:
user_input = input("👤 User: ")
if user_input.lower() in ["exit", "quit"]:
break
response = chat_inference(user_input)
print(f"🤖 Assistant: {response}\n")
```
---
## References
* Dataset: [Mattimax/DATA-AI_Conversation_ITA](https://huggingface.co/datasets/Mattimax/DATA-AI_Conversation_ITA)
* Base model: [DACMini](https://huggingface.co/Mattimax/DACMini)
* Organization: [M.INC](https://huggingface.co/MINC01)
* Collection: [Little_DAC Collection](https://huggingface.co/collections/Mattimax/little-dac-collection-68e11d19a5949d08e672b312)
---
## Citation
If you use **Mattimax/DACMini-IT** in a project, paper, or any work, please cite it using the `CITATION.bib` file included in the repository:
```bibtex
@misc{mattimax2025dacminiit,
title = {{Mattimax/DACMini-IT}: An open-source language model},
author = {Mattimax},
howpublished = {\url{https://huggingface.co/Mattimax/DACMini-IT}},
year = {2025},
note = {License: MIT. If you use this model, please cite the original source.}
}
```

4
added_tokens.json Normal file
View File

@@ -0,0 +1,4 @@
{
"<|pad|>": 30001,
"<|system|>": 30000
}

46
config.json Normal file
View File

@@ -0,0 +1,46 @@
{
"activation_function": "gelu_new",
"architectures": [
"GPT2LMHeadModel"
],
"attn_pdrop": 0.1,
"bos_token_id": 30000,
"dtype": "float32",
"embd_pdrop": 0.1,
"eos_token_id": 0,
"gradient_checkpointing": false,
"initializer_range": 0.02,
"layer_norm_epsilon": 1e-05,
"model_type": "gpt2",
"n_ctx": 1024,
"n_embd": 768,
"n_head": 12,
"n_inner": null,
"n_layer": 12,
"n_positions": 1024,
"pad_token_id": 30001,
"reorder_and_upcast_attn": false,
"resid_pdrop": 0.1,
"scale_attn_by_inverse_layer_idx": false,
"scale_attn_weights": true,
"summary_activation": null,
"summary_first_dropout": 0.1,
"summary_proj_to_labels": true,
"summary_type": "cls_index",
"summary_use_proj": true,
"task_specific_params": {
"text-generation": {
"do_sample": true,
"max_length": 100,
"no_repeat_ngram_size": 4,
"num_beams": 10,
"repetition_penalty": 10.0,
"temperature": 2.0,
"top_k": 20,
"top_p": 0.9
}
},
"transformers_version": "4.57.0",
"use_cache": true,
"vocab_size": 30002
}

9
generation_config.json Normal file
View File

@@ -0,0 +1,9 @@
{
"_from_model_config": true,
"bos_token_id": 30000,
"eos_token_id": [
0
],
"pad_token_id": 30001,
"transformers_version": "4.57.0"
}

29744
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a6e493356331bd4aac20e182e51329ba02e6af54f6ff1f52c28dc04bdb350a9
size 435550848

View File

@@ -0,0 +1,4 @@
{
"<|pad|>": 30001,
"<|system|>": 30000
}

View File

@@ -0,0 +1,47 @@
{
"activation_function": "gelu_new",
"architectures": [
"GPT2LMHeadModel"
],
"attn_pdrop": 0.1,
"bos_token_id": 30000,
"dtype": "float32",
"embd_pdrop": 0.1,
"eos_token_id": 0,
"gradient_checkpointing": false,
"initializer_range": 0.02,
"layer_norm_epsilon": 1e-05,
"model_type": "gpt2",
"n_ctx": 1024,
"n_embd": 768,
"n_head": 12,
"n_inner": null,
"n_layer": 12,
"n_positions": 1024,
"pad_token_id": 30001,
"reorder_and_upcast_attn": false,
"resid_pdrop": 0.1,
"scale_attn_by_inverse_layer_idx": false,
"scale_attn_weights": true,
"summary_activation": null,
"summary_first_dropout": 0.1,
"summary_proj_to_labels": true,
"summary_type": "cls_index",
"summary_use_proj": true,
"task_specific_params": {
"text-generation": {
"do_sample": true,
"max_length": 100,
"no_repeat_ngram_size": 4,
"num_beams": 10,
"repetition_penalty": 10.0,
"temperature": 2.0,
"top_k": 20,
"top_p": 0.9
}
},
"torch_dtype": "float32",
"transformers_version": "4.55.4",
"use_cache": false,
"vocab_size": 30002
}

View File

@@ -0,0 +1,9 @@
{
"_from_model_config": true,
"bos_token_id": 30000,
"eos_token_id": [
0
],
"pad_token_id": 30001,
"transformers_version": "4.55.4"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c852ac40afc81214236a147b1f2573fd075bafd064a79ef403a518ec4655e7b6
size 435940686

View File

@@ -0,0 +1,30 @@
{
"bos_token": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"30000": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"30001": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<|system|>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"extra_special_tokens": {},
"max_length": 512,
"model_max_length": 1000000000000000019884624838656,
"pad_to_multiple_of": null,
"pad_token": "<|pad|>",
"pad_token_type_id": 0,
"padding_side": "right",
"stride": 0,
"tokenizer_class": "GPT2Tokenizer",
"truncation_side": "right",
"truncation_strategy": "longest_first",
"unk_token": "<|endoftext|>"
}

File diff suppressed because one or more lines are too long

30
special_tokens_map.json Normal file
View File

@@ -0,0 +1,30 @@
{
"bos_token": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

149053
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

47
tokenizer_config.json Normal file
View File

@@ -0,0 +1,47 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"30000": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"30001": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<|system|>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"extra_special_tokens": {},
"max_length": 512,
"model_max_length": 1000000000000000019884624838656,
"pad_to_multiple_of": null,
"pad_token": "<|pad|>",
"pad_token_type_id": 0,
"padding_side": "right",
"stride": 0,
"tokenizer_class": "GPT2Tokenizer",
"truncation_side": "right",
"truncation_strategy": "longest_first",
"unk_token": "<|endoftext|>",
"chat_template": "{% if messages[0]['role'] != 'system' %}<|system|>\nTi chiami DACMini, un modello di intelligenza artificiale creato da M.INC.{% endif %}\n{% for message in messages %}{% if message['role'] == 'user' %}<|user|>\n{{ message['content'] }}{% elif message['role'] == 'assistant' %}<|assistant|>\n{{ message['content'] }}{% endif %}{% endfor %}\n<|assistant|>"
}

3
training_args.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d542748374d9b107613de2edff26ae1c5410d5b87edbf57cee57f3cb90272c0f
size 5777

1
vocab.json Normal file

File diff suppressed because one or more lines are too long