Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
This is a fine-tuned 13B chat model
|
| 6 |
+
|
| 7 |
+
code example
|
| 8 |
+
```
|
| 9 |
+
import torch
|
| 10 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 11 |
+
import math
|
| 12 |
+
|
| 13 |
+
## v2 models
|
| 14 |
+
model_path = "cloudyu/Mixtral_13B_Chat"
|
| 15 |
+
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
|
| 17 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 18 |
+
model_path, torch_dtype=torch.bfloat16, device_map='auto',local_files_only=False, load_in_4bit=True
|
| 19 |
+
)
|
| 20 |
+
print(model)
|
| 21 |
+
prompt = input("please input prompt:")
|
| 22 |
+
while len(prompt) > 0:
|
| 23 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
|
| 24 |
+
|
| 25 |
+
generation_output = model.generate(
|
| 26 |
+
input_ids=input_ids, max_new_tokens=800,repetition_penalty=1.2
|
| 27 |
+
)
|
| 28 |
+
print(tokenizer.decode(generation_output[0]))
|
| 29 |
+
prompt = input("please input prompt:")
|
| 30 |
+
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
output examples
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
<s> 12+13-24=?
|
| 37 |
+
To solve this equation, we need to follow the order of operations (PEMDAS/BODMAS): Parentheses, Exponents, Multiplication and Division (from left to right), Addition and Subtraction (from left to right).
|
| 38 |
+
|
| 39 |
+
Given expression: 12 + 13 - 24
|
| 40 |
+
First, let's add 12 and 13 together:
|
| 41 |
+
12 + 13 = 25
|
| 42 |
+
Now our expression looks like this: 25 - 24
|
| 43 |
+
Next, subtract 24 from 25:
|
| 44 |
+
25 - 24 = 1
|
| 45 |
+
So, the final answer is 1.</s>
|
| 46 |
+
```
|