Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -259,7 +259,7 @@ def compress_data_og(c, instruct, history):
|
|
| 259 |
hist = history[s:e]
|
| 260 |
|
| 261 |
resp = run_gpt(
|
| 262 |
-
|
| 263 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
| 264 |
max_tokens=8192,
|
| 265 |
seed=seed,
|
|
@@ -273,7 +273,7 @@ def compress_data_og(c, instruct, history):
|
|
| 273 |
out+=resp
|
| 274 |
e=e+chunk
|
| 275 |
s=s+chunk
|
| 276 |
-
|
| 277 |
resp = run_gpt(
|
| 278 |
COMPRESS_DATA_PROMPT,
|
| 279 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
|
@@ -282,7 +282,7 @@ def compress_data_og(c, instruct, history):
|
|
| 282 |
direction=instruct,
|
| 283 |
knowledge=new_history,
|
| 284 |
history="All data has been recieved.",
|
| 285 |
-
)
|
| 286 |
print ("final" + resp)
|
| 287 |
#history = "observation: {}\n".format(resp)
|
| 288 |
return resp
|
|
@@ -358,6 +358,7 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
| 358 |
|
| 359 |
#json_object = json.dumps(json_out, indent=4)
|
| 360 |
json_box.append(json_out)
|
|
|
|
| 361 |
# Writing to sample.json
|
| 362 |
#with open("tmp.json", "w") as outfile:
|
| 363 |
# outfile.write(json_object)
|
|
@@ -372,7 +373,7 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
| 372 |
if i == " " or i=="," or i=="\n":
|
| 373 |
c +=1
|
| 374 |
print (f'c2:: {c}')
|
| 375 |
-
rawp =
|
| 376 |
else:
|
| 377 |
rawp = "Provide a valid data source"
|
| 378 |
#print (rawp)
|
|
|
|
| 259 |
hist = history[s:e]
|
| 260 |
|
| 261 |
resp = run_gpt(
|
| 262 |
+
COMPRESS_DATA_PROMPT,
|
| 263 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
| 264 |
max_tokens=8192,
|
| 265 |
seed=seed,
|
|
|
|
| 273 |
out+=resp
|
| 274 |
e=e+chunk
|
| 275 |
s=s+chunk
|
| 276 |
+
'''
|
| 277 |
resp = run_gpt(
|
| 278 |
COMPRESS_DATA_PROMPT,
|
| 279 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
|
|
|
| 282 |
direction=instruct,
|
| 283 |
knowledge=new_history,
|
| 284 |
history="All data has been recieved.",
|
| 285 |
+
)'''
|
| 286 |
print ("final" + resp)
|
| 287 |
#history = "observation: {}\n".format(resp)
|
| 288 |
return resp
|
|
|
|
| 358 |
|
| 359 |
#json_object = json.dumps(json_out, indent=4)
|
| 360 |
json_box.append(json_out)
|
| 361 |
+
print(f'JSON_BOX:: {json_box}')
|
| 362 |
# Writing to sample.json
|
| 363 |
#with open("tmp.json", "w") as outfile:
|
| 364 |
# outfile.write(json_object)
|
|
|
|
| 373 |
if i == " " or i=="," or i=="\n":
|
| 374 |
c +=1
|
| 375 |
print (f'c2:: {c}')
|
| 376 |
+
rawp = compress_data_og(c,inp,out)
|
| 377 |
else:
|
| 378 |
rawp = "Provide a valid data source"
|
| 379 |
#print (rawp)
|