Spaces:
Runtime error
Runtime error
Update agents/software_architect_agent.py
Browse files
agents/software_architect_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": "Software Architect", "content": output}]
|
20 |
+
return {"pm_output": output, "chat_log": new_log}
|