Spaces:
Running
Running
broadfield
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -181,8 +181,8 @@ def agent(prompt_in,history,mod=2):
|
|
181 |
yield [{'role':'assistant','content':str(outph)}]
|
182 |
role="MANAGER"
|
183 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
184 |
-
|
185 |
-
outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
186 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
187 |
yield [{'role':'assistant','content':str(outp0)}]
|
188 |
for line in outp0.split("\n"):
|
@@ -190,7 +190,7 @@ def agent(prompt_in,history,mod=2):
|
|
190 |
try:
|
191 |
com_line = line.split('action:')[1]
|
192 |
fn = com_line.split('action_input=')[0]
|
193 |
-
com = com_line.split('action_input=')[1]
|
194 |
#com = com_line.split('action_input=')[1].replace('<|im_end|>','').replace("}","").replace("]","").replace("'","")
|
195 |
print(com)
|
196 |
except Exception as e:
|
|
|
181 |
yield [{'role':'assistant','content':str(outph)}]
|
182 |
role="MANAGER"
|
183 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
184 |
+
outp0=list(outp)[0].split('<|im_end}>')[0]
|
185 |
+
#outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
186 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
187 |
yield [{'role':'assistant','content':str(outp0)}]
|
188 |
for line in outp0.split("\n"):
|
|
|
190 |
try:
|
191 |
com_line = line.split('action:')[1]
|
192 |
fn = com_line.split('action_input=')[0]
|
193 |
+
com = com_line.split('action_input=')[1]
|
194 |
#com = com_line.split('action_input=')[1].replace('<|im_end|>','').replace("}","").replace("]","").replace("'","")
|
195 |
print(com)
|
196 |
except Exception as e:
|