File size: 2,615 Bytes
4b545c8
 
 
7017d79
 
fca30d6
 
4b545c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7017d79
 
 
 
 
4b545c8
 
 
 
 
 
7017d79
4b545c8
 
 
 
7017d79
 
 
4b545c8
 
 
 
fc09132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b545c8
 
 
 
 
 
 
 
fc09132
4b545c8
7017d79
 
 
 
 
 
 
4b545c8
 
 
 
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
---
library_name: peft
base_model: meta-math/MetaMath-Mistral-7B
license: apache-2.0
pipeline_tag: text2text-generation
language:
- en
---

# Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->



## Model Details

### Model Description

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



- **Developed by:** Timofej Kiselev (tfshaman)
- **Model type:** Mistral finetuned for solving MWPs using symbolic expressions with SymPy
- **Language(s) (NLP):** English, Python with SymPy 
- **License:** Apache-2.0
- **Finetuned from model [optional]:** meta-math/MetaMath-Mistral-7B

### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:** [More Information Needed]
- **Paper [optional]:** https://dspace.cvut.cz/bitstream/handle/10467/115466/F3-BP-2024-Kiselev-Timofej-Thesis_Timofej_Kiselev.pdf

## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
Input format:
f"Question {your_math_word_problem}\n\nAnswer: "


### Direct Use

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
```python
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16, 
)
config = PeftConfig.from_pretrained("tfshaman/SymPy-Mistral")
base_model = AutoModelForCausalLM.from_pretrained("meta-math/MetaMath-Mistral-7B", quantization_config=bnb_config)
tokenizer = AutoTokenizer.from_pretrained("tfshaman/SymPy-Mistral-tokenizer", use_fast=False, padding_side="left")
base_model.resize_token_embeddings(len(tokenizer))
tokenizer.pad_token = "<s>"
tokenizer.padding_side='left'
model = PeftModel.from_pretrained(base_model, "tfshaman/SymPy-Mistral", quantization_config=bnb_config)
model = model.to("cuda")

```
[More Information Needed]

### Downstream Use [optional]

<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->

[More Information Needed]

## Citation 
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
@mastersthesis{timofej2024velke,
  title={Velk{\'e} jazykov{\'e} modely pro numerick{\'e} dotazy},
  author={Timofej, Kiselev},
  type={{B.S.} thesis},
  year={2024},
  school={{\v{C}}esk{\'e} vysok{\'e} u{\v{c}}en{\'\i} technick{\'e} v Praze. Vypo{\v{c}}etn{\'\i} a informa{\v{c}}n{\'\i} centrum.}
}

### Framework versions

- PEFT 0.7.1