Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,12 +176,12 @@ def summarize(inp,history,data=None,files=None):
|
|
| 176 |
except Exception as e:
|
| 177 |
data = "Error"
|
| 178 |
print (e)
|
| 179 |
-
if
|
| 180 |
print(inp)
|
| 181 |
out = str(data)
|
| 182 |
rl = len(out)
|
| 183 |
print(f'rl:: {rl}')
|
| 184 |
-
c=
|
| 185 |
for i in str(out):
|
| 186 |
if i == " " or i=="," or i=="\n":
|
| 187 |
c +=1
|
|
@@ -189,7 +189,7 @@ def summarize(inp,history,data=None,files=None):
|
|
| 189 |
|
| 190 |
rawp = compress_data(c,inp,out)
|
| 191 |
else:
|
| 192 |
-
rawp = "
|
| 193 |
#print (rawp)
|
| 194 |
#print (f'out:: {out}')
|
| 195 |
#history += "observation: the search results are:\n {}\n".format(out)
|
|
|
|
| 176 |
except Exception as e:
|
| 177 |
data = "Error"
|
| 178 |
print (e)
|
| 179 |
+
if data != "Error" and data != "":
|
| 180 |
print(inp)
|
| 181 |
out = str(data)
|
| 182 |
rl = len(out)
|
| 183 |
print(f'rl:: {rl}')
|
| 184 |
+
c=1
|
| 185 |
for i in str(out):
|
| 186 |
if i == " " or i=="," or i=="\n":
|
| 187 |
c +=1
|
|
|
|
| 189 |
|
| 190 |
rawp = compress_data(c,inp,out)
|
| 191 |
else:
|
| 192 |
+
rawp = "Provide a valid data source"
|
| 193 |
#print (rawp)
|
| 194 |
#print (f'out:: {out}')
|
| 195 |
#history += "observation: the search results are:\n {}\n".format(out)
|