Update README.md
Browse files
README.md
CHANGED
@@ -29,11 +29,13 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
29 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
30 |
|
31 |
instruction = "Please reason step by step, and put your final answer within \\boxed{}."
|
32 |
-
prompt =
|
33 |
-
# prompt =
|
|
|
|
|
34 |
|
35 |
messages = [
|
36 |
-
{"role": "user", "content": prompt}
|
37 |
]
|
38 |
|
39 |
text = tokenizer.apply_chat_template(
|
@@ -46,7 +48,7 @@ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
|
46 |
|
47 |
generated_ids = model.generate(
|
48 |
**model_inputs,
|
49 |
-
max_new_tokens=
|
50 |
)
|
51 |
generated_ids = [
|
52 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
@@ -60,7 +62,6 @@ think_mode = ("<think>" in response)
|
|
60 |
print(text+response)
|
61 |
print(f"\nThink Mode: {think_mode}")
|
62 |
print(f"Number of tokens: {num_tokens}")
|
63 |
-
|
64 |
```
|
65 |
|
66 |
|
|
|
29 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
30 |
|
31 |
instruction = "Please reason step by step, and put your final answer within \\boxed{}."
|
32 |
+
# prompt = "How many r's are in the word \"strawberry\""
|
33 |
+
# prompt = "The arithmetic mean of 7, 2, $x$ and 10 is 9. What is the value of $x$?"
|
34 |
+
prompt = "Let $S$ be the set of points $(a,b)$ with $0 \le a,$ $b \le 1$ such that the equation \[x^4 + ax^3 - bx^2 + ax + 1 = 0\] has at least one real root. Determine the area of the graph of $S.$"
|
35 |
+
|
36 |
|
37 |
messages = [
|
38 |
+
{"role": "user", "content": f"{instruction}\n{prompt}"},
|
39 |
]
|
40 |
|
41 |
text = tokenizer.apply_chat_template(
|
|
|
48 |
|
49 |
generated_ids = model.generate(
|
50 |
**model_inputs,
|
51 |
+
max_new_tokens=16384
|
52 |
)
|
53 |
generated_ids = [
|
54 |
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
|
|
62 |
print(text+response)
|
63 |
print(f"\nThink Mode: {think_mode}")
|
64 |
print(f"Number of tokens: {num_tokens}")
|
|
|
65 |
```
|
66 |
|
67 |
|