Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import urllib.request
|
| 3 |
-
import requests
|
| 4 |
-
import bs4
|
| 5 |
-
import lxml
|
| 6 |
import os
|
| 7 |
#import subprocess
|
| 8 |
from huggingface_hub import InferenceClient,HfApi
|
|
@@ -10,7 +10,8 @@ import random
|
|
| 10 |
import json
|
| 11 |
import datetime
|
| 12 |
#from query import tasks
|
| 13 |
-
from
|
|
|
|
| 14 |
COMPRESS_DATA_PROMPT,
|
| 15 |
COMPRESS_DATA_PROMPT_SMALL,
|
| 16 |
LOG_PROMPT,
|
|
@@ -133,7 +134,7 @@ def compress_data(c,purpose, task, history):
|
|
| 133 |
out+=resp
|
| 134 |
e=e+chunk
|
| 135 |
s=s+chunk
|
| 136 |
-
|
| 137 |
resp = run_gpt(
|
| 138 |
COMPRESS_DATA_PROMPT,
|
| 139 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
|
@@ -143,7 +144,7 @@ def compress_data(c,purpose, task, history):
|
|
| 143 |
task=task,
|
| 144 |
knowledge=new_history,
|
| 145 |
history="All data has been recieved.",
|
| 146 |
-
)
|
| 147 |
print ("final" + resp)
|
| 148 |
history = "observation: {}\n".format(resp)
|
| 149 |
return history
|
|
@@ -165,7 +166,7 @@ def summarize(inp,file=None):
|
|
| 165 |
print (f'out:: {out}')
|
| 166 |
#history += "observation: the search results are:\n {}\n".format(out)
|
| 167 |
task = "complete?"
|
| 168 |
-
return
|
| 169 |
#################################
|
| 170 |
|
| 171 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
#import urllib.request
|
| 3 |
+
#import requests
|
| 4 |
+
#import bs4
|
| 5 |
+
#import lxml
|
| 6 |
import os
|
| 7 |
#import subprocess
|
| 8 |
from huggingface_hub import InferenceClient,HfApi
|
|
|
|
| 10 |
import json
|
| 11 |
import datetime
|
| 12 |
#from query import tasks
|
| 13 |
+
from agent import (
|
| 14 |
+
PREFIX,
|
| 15 |
COMPRESS_DATA_PROMPT,
|
| 16 |
COMPRESS_DATA_PROMPT_SMALL,
|
| 17 |
LOG_PROMPT,
|
|
|
|
| 134 |
out+=resp
|
| 135 |
e=e+chunk
|
| 136 |
s=s+chunk
|
| 137 |
+
|
| 138 |
resp = run_gpt(
|
| 139 |
COMPRESS_DATA_PROMPT,
|
| 140 |
stop_tokens=["observation:", "task:", "action:", "thought:"],
|
|
|
|
| 144 |
task=task,
|
| 145 |
knowledge=new_history,
|
| 146 |
history="All data has been recieved.",
|
| 147 |
+
)
|
| 148 |
print ("final" + resp)
|
| 149 |
history = "observation: {}\n".format(resp)
|
| 150 |
return history
|
|
|
|
| 166 |
print (f'out:: {out}')
|
| 167 |
#history += "observation: the search results are:\n {}\n".format(out)
|
| 168 |
task = "complete?"
|
| 169 |
+
return rawp
|
| 170 |
#################################
|
| 171 |
|
| 172 |
|