UPDATE
Browse files
README.md
CHANGED
|
@@ -7,4 +7,71 @@ language:
|
|
| 7 |
metrics:
|
| 8 |
- accuracy
|
| 9 |
pipeline_tag: question-answering
|
| 10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
metrics:
|
| 8 |
- accuracy
|
| 9 |
pipeline_tag: question-answering
|
| 10 |
+
---
|
| 11 |
+
# Model Card for Finetuned Mistral-7B on Orca Math Word Problems
|
| 12 |
+
|
| 13 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 14 |
+
|
| 15 |
+
Ce modèle est une version du Mistral-7B finement entraînée avec la technique QLoRA (Low-Rank Adaptation) sur le jeu de données Orca-Math Word Problems pour résoudre des problèmes mathématiques en langage naturel.
|
| 16 |
+
|
| 17 |
+
## Model Details
|
| 18 |
+
|
| 19 |
+
### Model Description
|
| 20 |
+
|
| 21 |
+
- **Developed by:** Anthropic
|
| 22 |
+
- **Model type:** Modèle de langage causal (causal language model)
|
| 23 |
+
- **Language(s) (NLP):** Anglais
|
| 24 |
+
- **Finetuned from model:** Mistral-7B-v0.1 de MistralAI
|
| 25 |
+
- **License:** [Plus d'informations nécessaires]
|
| 26 |
+
|
| 27 |
+
### Model Sources
|
| 28 |
+
|
| 29 |
+
- **Repository:** https://huggingface.co/jeanflop/Mistral_Orcas_7B
|
| 30 |
+
|
| 31 |
+
## Uses
|
| 32 |
+
|
| 33 |
+
### Direct Use
|
| 34 |
+
|
| 35 |
+
Le modèle est un modèle de langage causal entraîné sur le jeu de données Orca-Math Word Problems pour résoudre des problèmes mathématiques en langage naturel.
|
| 36 |
+
|
| 37 |
+
Pour utiliser le modèle, vous pouvez charger le modèle et le tokenizer à partir des chemins locaux, puis générer une sortie avec la méthode `generate`:
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
+
|
| 42 |
+
model = AutoModelForCausalLM.from_pretrained("/path/to/model")
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained("/path/to/tokenizer")
|
| 44 |
+
|
| 45 |
+
prompt = "Given the coherent answer sentence to a given problem as an input sentence..."
|
| 46 |
+
|
| 47 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
|
| 48 |
+
|
| 49 |
+
output = model.generate(input_ids, max_new_tokens=100)
|
| 50 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 51 |
+
|
| 52 |
+
Training Details
|
| 53 |
+
Training Data
|
| 54 |
+
Dataset: microsoft/orca-math-word-problems-200k
|
| 55 |
+
Training Procedure
|
| 56 |
+
Preprocessing
|
| 57 |
+
|
| 58 |
+
def tokenize(prompt):
|
| 59 |
+
result = tokenizer(
|
| 60 |
+
prompt,
|
| 61 |
+
truncation=True,
|
| 62 |
+
max_length=512,
|
| 63 |
+
padding="max_length",
|
| 64 |
+
)
|
| 65 |
+
result['labels'] = result['input_ids'].copy()
|
| 66 |
+
return result
|
| 67 |
+
|
| 68 |
+
def generate_and_tokenize_prompt(data_point):
|
| 69 |
+
full_prompt = f"""Given the logical, mathematical, and coherent answer to a given problem as an input sentence. The entry contains all the information needed to answer the question.
|
| 70 |
+
### Question
|
| 71 |
+
{data_point["question"]}
|
| 72 |
+
|
| 73 |
+
### Logical sentences answers
|
| 74 |
+
{data_point["answer"]}
|
| 75 |
+
"""
|
| 76 |
+
return tokenize(full_prompt)
|
| 77 |
+
|