Omnibus commited on
Commit
344fa98
·
1 Parent(s): a6637aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 not data == "Error":
180
  print(inp)
181
  out = str(data)
182
  rl = len(out)
183
  print(f'rl:: {rl}')
184
- c=0
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 = "Error"
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)