Update README.md
Browse files
README.md
CHANGED
@@ -24,6 +24,54 @@ This model is a fine-tuned version of the **Qwen2.5-0.5B-Instruct** model, speci
|
|
24 |
|
25 |
## Model Details
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
### Model Description
|
28 |
|
29 |
- **Developed by:** [Your Name or Organization]
|
@@ -70,21 +118,3 @@ Users should:
|
|
70 |
- Fine-tune the model further for domain-specific tasks.
|
71 |
- Be aware of potential biases and limitations in reasoning capabilities.
|
72 |
|
73 |
-
## How to Get Started with the Model
|
74 |
-
|
75 |
-
Use the code below to load and use the model:
|
76 |
-
|
77 |
-
```python
|
78 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
79 |
-
|
80 |
-
model_name = "[Your Model Name on Hugging Face Hub]"
|
81 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
82 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
83 |
-
|
84 |
-
# Example input
|
85 |
-
input_text = "There are 15 apples in a basket. If 3 are removed, how many apples are left?"
|
86 |
-
inputs = tokenizer(input_text, return_tensors="pt")
|
87 |
-
|
88 |
-
# Generate output
|
89 |
-
outputs = model.generate(**inputs)
|
90 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
|
24 |
|
25 |
## Model Details
|
26 |
|
27 |
+
## How to Get Started with the Model
|
28 |
+
|
29 |
+
Use the code below to load and use the model:
|
30 |
+
|
31 |
+
```python
|
32 |
+
from unsloth import FastLanguageModel
|
33 |
+
from vllm import SamplingParams
|
34 |
+
import torch
|
35 |
+
|
36 |
+
# Load the Model & Tokenizer
|
37 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
38 |
+
model_name = "AdamLucek/Qwen2.5-3B-Instruct-GRPO-2K-GSM8K",
|
39 |
+
max_seq_length = 2048,
|
40 |
+
load_in_4bit = True,
|
41 |
+
fast_inference = True,
|
42 |
+
gpu_memory_utilization = 0.7,
|
43 |
+
)
|
44 |
+
|
45 |
+
# Prep the Message
|
46 |
+
PROMPT = "How many r's are in the word strawberry?"
|
47 |
+
|
48 |
+
SYSTEM_PROMPT = """
|
49 |
+
Respond in the following format:
|
50 |
+
<reasoning>
|
51 |
+
...
|
52 |
+
</reasoning>
|
53 |
+
<answer>
|
54 |
+
...
|
55 |
+
</answer>
|
56 |
+
"""
|
57 |
+
|
58 |
+
text = tokenizer.apply_chat_template([
|
59 |
+
{"role" : "system", "content" : SYSTEM_PROMPT},
|
60 |
+
{"role" : "user", "content" : PROMPT},
|
61 |
+
], tokenize = False, add_generation_prompt = True)
|
62 |
+
|
63 |
+
# Generate a response
|
64 |
+
sampling_params = SamplingParams(
|
65 |
+
temperature = 0.8,
|
66 |
+
top_p = 0.95,
|
67 |
+
max_tokens = 1024,
|
68 |
+
)
|
69 |
+
output = model.fast_generate(
|
70 |
+
text,
|
71 |
+
sampling_params = sampling_params,
|
72 |
+
)[0].outputs[0].text
|
73 |
+
```
|
74 |
+
|
75 |
### Model Description
|
76 |
|
77 |
- **Developed by:** [Your Name or Organization]
|
|
|
118 |
- Fine-tune the model further for domain-specific tasks.
|
119 |
- Be aware of potential biases and limitations in reasoning capabilities.
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|