File size: 1,426 Bytes
1151de2
 
e12c0fb
 
 
 
 
 
 
 
 
74d9e0d
 
 
 
 
 
 
9ad925a
74d9e0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
language:
- it
- en
library_name: transformers
tags:
- sft
- it
- mistral
- chatml
---

# Model Information

xxxx is a SFT and LoRA finetuned version of Mistral-7B-v0.2 

It has been trained on a mixture of opensource datasets, like SQUAD-it (https://huggingface.co/datasets/squad_it), and some internally made datasets.

It is not just a Q&A, it is a Q&A + Context model, with the goal being it being used for RAGs and application in need of a context.


## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda"

model = AutoModelForCausalLM.from_pretrained("MoxoffSpA/xxxx")
tokenizer = AutoTokenizer.from_pretrained("MoxoffSpA/xxxx")

question = """Quanto è alta la torre di Pisa?"""
context = """
La Torre di Pisa è un campanile del XII secolo, famoso per la sua inclinazione. Alta circa 56 metri.
"""
prompt = f"Rispondi alla seguente domanda con meno parle possibili basandoti sul contesto fornito. Domanda: {question}, contesto: {context}"

messages = [
    {"role": "user", "content": prompt},
]

encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")

model_inputs = encodeds.to(device)
model.to(device)

generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
```


## The Moxoff Team
Marco D'Ambra, Jacopo Abate, Gianpaolo Francesco Trotta