File size: 3,032 Bytes
6fbc346
6b9123b
9e0ff22
 
 
 
 
 
 
 
 
860a6f7
9e0ff22
 
 
 
 
6fbc346
 
dd76069
6fbc346
dd76069
6fbc346
 
 
 
 
 
 
 
 
9e0ff22
dd76069
9e0ff22
fb649c2
6fbc346
9a8df92
 
 
 
 
b608306
9a8df92
b608306
 
9a8df92
6fbc346
9e0ff22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63804de
9e0ff22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
license: cc-by-nc-sa-4.0
language:
- it
pipeline_tag: text-generation
tags:
- text-generation-inference
- transformers
- mistral
- trl
- sft
base_model: sapienzanlp/Minerva-3B-base-v1.0
datasets:
- mchl-labs/stambecco_data_it
widget:
- text: "Di seguito è riportata un'istruzione che descrive un'attività, abbinata ad un input che fornisce ulteriore informazione. Scrivi una risposta che soddisfi adeguatamente la richiesta. \n### Istruzione:\nSuggerisci un'attività serale romantica\n\n### Input:\n\n### Risposta:"
  example_title: Example 1
---

# Model Card for Minerva-3B-Instruct-v1.0

Minerva-3B-Instruct-v1.0 is an instruction-tuned version of the Minerva-3B-base-v1.0 model, specifically fine-tuned for understanding and following instructions in Italian.



## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->

- **Developed by:** Walid Iguider
- **Model type:** Instruction Tuned
- **License:** cc-by-nc-sa-4.0
- **Finetuned from model:** [Minerva-3B-base-v1.0](https://huggingface.co/sapienzanlp/Minerva-3B-base-v1.0), developed by [Sapienza NLP](https://nlp.uniroma1.it) in collaboration with [Future Artificial Intelligence Research (FAIR)](https://fondazione-fair.it/) and [CINECA](https://www.cineca.it/)

## Evaluation

For a detailed comparison of model performance, check out the [Leaderboard for Italian Language Models](https://huggingface.co/spaces/FinancialSupport/open_ita_llm_leaderboard).

Here's a breakdown of the performance metrics:
| Model/metric                      | hellaswag_it acc_norm | arc_it acc_norm | m_mmlu_it 5-shot acc | Average |
|:----------------------------|:----------------------|:----------------|:---------------------|:--------|
| **Minerva-3B-Instruct-v1.0**     | 0.5197                | 0.3157        | 0.2631              | 0.366  |
| Minerva-3B-base-v1.0     | 0.5187                | 0.3045        | 0.2612              | 0.361  |


### Sample Code

```python
  from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
  import torch
  torch.random.manual_seed(0)
  # Run text generation pipeline with our next model
  prompt = """Di seguito è riportata un'istruzione che descrive un'attività, abbinata ad un input che fornisce
  ulteriore informazione. Scrivi una risposta che soddisfi adeguatamente la richiesta.
  
  ### Istruzione:
  Suggerisci un'attività serale romantica

  ### Input:
  
  
  ### Risposta:"""
  
  model_id = "FairMind/Minerva-3B-Instruct-v1.0"
  tokenizer = AutoTokenizer.from_pretrained(model_id)
  model = AutoModelForCausalLM.from_pretrained(
      model_id, 
      device_map="cuda", 
      torch_dtype="auto", 
      trust_remote_code=True, 
  )
  
  generation_args = {
      "max_new_tokens": 500,
      "return_full_text": False,
      "temperature": 0.0,
      "do_sample": False,
  }
  
  pipe = pipeline(
      "text-generation",
      model=model,
      tokenizer=tokenizer,
  )
  
  output = pipe(prompt, **generation_args)
  print(output[0]['generated_text'])
```