Spaces:
Build error
Build error
Ravi theja K
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torch
|
|
| 6 |
from transformers import AutoModel, AutoTokenizer
|
| 7 |
from deepspeed.linear.config import QuantizationConfig
|
| 8 |
|
| 9 |
-
|
| 10 |
"Snowflake/snowflake-arctic-instruct",
|
| 11 |
trust_remote_code=True
|
| 12 |
)
|
|
@@ -24,7 +24,7 @@ model = AutoModel.from_pretrained(
|
|
| 24 |
|
| 25 |
content = "5x + 35 = 7x - 60 + 10. Solve for x"
|
| 26 |
messages = [{"role": "user", "content": content}]
|
| 27 |
-
input_ids =
|
| 28 |
|
| 29 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=256)
|
| 30 |
-
print(
|
|
|
|
| 6 |
from transformers import AutoModel, AutoTokenizer
|
| 7 |
from deepspeed.linear.config import QuantizationConfig
|
| 8 |
|
| 9 |
+
Llamatokenizertokenizer = AutoTokenizer.from_pretrained(
|
| 10 |
"Snowflake/snowflake-arctic-instruct",
|
| 11 |
trust_remote_code=True
|
| 12 |
)
|
|
|
|
| 24 |
|
| 25 |
content = "5x + 35 = 7x - 60 + 10. Solve for x"
|
| 26 |
messages = [{"role": "user", "content": content}]
|
| 27 |
+
input_ids = Llamatokenizertokenizertokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
|
| 28 |
|
| 29 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=256)
|
| 30 |
+
print(Llamatokenizertokenizertokenizer.decode(outputs[0]))
|