Spaces:
Runtime error
Runtime error
Update agents/project_manager_agent.py
Browse files
agents/project_manager_agent.py
CHANGED
|
@@ -10,7 +10,11 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 10 |
device_map="auto"
|
| 11 |
)
|
| 12 |
|
| 13 |
-
def run(
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
device_map="auto"
|
| 11 |
)
|
| 12 |
|
| 13 |
+
def run(state):
|
| 14 |
+
prompt = state["input"]
|
| 15 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
|
| 16 |
+
output_ids = model.generate(input_ids, max_new_tokens=512)
|
| 17 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 18 |
+
|
| 19 |
+
new_log = state["chat_log"] + [{"role": "Project Manager", "content": output}]
|
| 20 |
+
return {"pm_output": output, "chat_log": new_log}
|