Rahul-8799 commited on
Commit
ae6dd56
·
verified ·
1 Parent(s): f91a57e

Update agents/software_architect_agent.py

Browse files
Files changed (1) hide show
  1. agents/software_architect_agent.py +8 -4
agents/software_architect_agent.py CHANGED
@@ -10,7 +10,11 @@ model = AutoModelForCausalLM.from_pretrained(
10
  device_map="auto"
11
  )
12
 
13
- def run(prompt):
14
- inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
15
- outputs = model.generate(**inputs, max_new_tokens=512)
16
- return tokenizer.decode(outputs[0], skip_special_tokens=True)
 
 
 
 
 
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}