Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -228,13 +228,13 @@ def agent(prompt_in,history,mod=2):
|
|
| 228 |
in_data[4]=outph
|
| 229 |
print(outph)
|
| 230 |
history=history+[{'role':'assistant','content':str(outph)}]
|
| 231 |
-
yield
|
| 232 |
role="MANAGER"
|
| 233 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
| 234 |
outp0=list(outp)[0].split('<|im_end|>')[0]
|
| 235 |
#outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
| 236 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
| 237 |
-
yield
|
| 238 |
for line in outp0.split("\n"):
|
| 239 |
if "action:" in line:
|
| 240 |
try:
|
|
@@ -254,6 +254,7 @@ def agent(prompt_in,history,mod=2):
|
|
| 254 |
ret1,ret2 = parse_json(out_w[2].split('<|im_end|>')[0])
|
| 255 |
build_space('test1',ret1,ret2)
|
| 256 |
history+=[{'role':'system','content':f'We just successfully build the file: {ret1}'}]
|
|
|
|
| 257 |
elif 'IMAGE' in fn:
|
| 258 |
print('IMAGE called')
|
| 259 |
#out_im=gen_im(prompt,seed)
|
|
|
|
| 228 |
in_data[4]=outph
|
| 229 |
print(outph)
|
| 230 |
history=history+[{'role':'assistant','content':str(outph)}]
|
| 231 |
+
yield history
|
| 232 |
role="MANAGER"
|
| 233 |
outp=generate(prompt,history,mod,128,seed,role,in_data)
|
| 234 |
outp0=list(outp)[0].split('<|im_end|>')[0]
|
| 235 |
#outp0 = re.sub('[^a-zA-Z0-9\s.,?!%()]', '', outpp)
|
| 236 |
history=history+[{'role':'assistant','content':str(outp0)}]
|
| 237 |
+
yield history
|
| 238 |
for line in outp0.split("\n"):
|
| 239 |
if "action:" in line:
|
| 240 |
try:
|
|
|
|
| 254 |
ret1,ret2 = parse_json(out_w[2].split('<|im_end|>')[0])
|
| 255 |
build_space('test1',ret1,ret2)
|
| 256 |
history+=[{'role':'system','content':f'We just successfully build the file: {ret1}'}]
|
| 257 |
+
yield history
|
| 258 |
elif 'IMAGE' in fn:
|
| 259 |
print('IMAGE called')
|
| 260 |
#out_im=gen_im(prompt,seed)
|