Spaces:
Running
Running
broadfield
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -192,7 +192,7 @@ def agent(prompt_in,history,mod=2):
|
|
192 |
yield [{'role':'assistant','content':str(outph)}]
|
193 |
role="MANAGER"
|
194 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
195 |
-
outp0=list(outp)[0].split('<|im_end
|
196 |
#outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
197 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
198 |
yield [{'role':'assistant','content':str(outp0)}]
|
@@ -201,7 +201,7 @@ def agent(prompt_in,history,mod=2):
|
|
201 |
try:
|
202 |
com_line = line.split('action:')[1]
|
203 |
fn = com_line.split('action_input=')[0]
|
204 |
-
com = com_line.split('action_input=')[1]
|
205 |
#com = com_line.split('action_input=')[1].replace('<|im_end|>','').replace("}","").replace("]","").replace("'","")
|
206 |
print(com)
|
207 |
except Exception as e:
|
|
|
192 |
yield [{'role':'assistant','content':str(outph)}]
|
193 |
role="MANAGER"
|
194 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
195 |
+
outp0=list(outp)[0].split('<|im_end|>')[0]
|
196 |
#outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
197 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
198 |
yield [{'role':'assistant','content':str(outp0)}]
|
|
|
201 |
try:
|
202 |
com_line = line.split('action:')[1]
|
203 |
fn = com_line.split('action_input=')[0]
|
204 |
+
com = com_line.split('action_input=')[1].split('<|im_end|>')[0]
|
205 |
#com = com_line.split('action_input=')[1].replace('<|im_end|>','').replace("}","").replace("]","").replace("'","")
|
206 |
print(com)
|
207 |
except Exception as e:
|