Spaces:
Runtime error
Runtime error
Update agents/product_manager_agent.py
Browse files
agents/product_manager_agent.py
CHANGED
|
@@ -13,9 +13,9 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 13 |
def run(state):
|
| 14 |
"""Generates structured product requirements from user input prompt."""
|
| 15 |
prompt = state["input"]
|
| 16 |
-
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
|
| 17 |
output_ids = model.generate(input_ids, max_new_tokens=512)
|
| 18 |
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 19 |
|
| 20 |
new_log = state["chat_log"] + [{"role": "Product Manager", "content": output}]
|
| 21 |
-
return {"pm_output": output, "chat_log": new_log}
|
|
|
|
| 13 |
def run(state):
|
| 14 |
"""Generates structured product requirements from user input prompt."""
|
| 15 |
prompt = state["input"]
|
| 16 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
|
| 17 |
output_ids = model.generate(input_ids, max_new_tokens=512)
|
| 18 |
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 19 |
|
| 20 |
new_log = state["chat_log"] + [{"role": "Product Manager", "content": output}]
|
| 21 |
+
return {"pm_output": output, "chat_log": new_log}
|