Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,6 +23,13 @@ outputs = pipeline(
|
|
| 23 |
messages[1]["content"], # Use only the user message here
|
| 24 |
max_new_tokens=256, # Limit the number of tokens generated
|
| 25 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Print the generated text from the output
|
| 28 |
print(outputs[0]["generated_text"])
|
|
|
|
| 23 |
messages[1]["content"], # Use only the user message here
|
| 24 |
max_new_tokens=256, # Limit the number of tokens generated
|
| 25 |
)
|
| 26 |
+
pipeline = transformers.pipeline(
|
| 27 |
+
"text-generation",
|
| 28 |
+
model=model_id,
|
| 29 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 30 |
+
device=-1, # Use CPU (avoid device_map)
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
|
| 34 |
# Print the generated text from the output
|
| 35 |
print(outputs[0]["generated_text"])
|