ThePixOne commited on
Commit
17ad30c
1 Parent(s): 7e110c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -84,11 +84,12 @@ def predict(query,data):
84
  name_to_save = data.name.split("/")[-1].split(".")[0][:-8]
85
  print(name_to_save)
86
  st = str([query,name_to_save])
87
- hist = st + " " + str(hashlib.sha256(st.encode()).hexdigest())
 
88
  now = datetime.now()
89
  current_time = now.strftime("%H:%M:%S")
90
  try:
91
- df = pd.read_csv("{}.csv".format(hash(st)))
92
  return df
93
  except Exception as e:
94
  print(e)
@@ -161,7 +162,7 @@ def predict(query,data):
161
  f.write(" " + str(current_time))
162
  f.write("\n")
163
  f.close()
164
- df.to_csv("{}.csv".format(hash(st)), index=False)
165
 
166
  return df
167
 
 
84
  name_to_save = data.name.split("/")[-1].split(".")[0][:-8]
85
  print(name_to_save)
86
  st = str([query,name_to_save])
87
+ st_hashed = str(hashlib.sha256(st.encode()).hexdigest()) #just to speed up examples load
88
+ hist = st + " " + st_hashed
89
  now = datetime.now()
90
  current_time = now.strftime("%H:%M:%S")
91
  try:
92
+ df = pd.read_csv("{}.csv".format(st_hashed))
93
  return df
94
  except Exception as e:
95
  print(e)
 
162
  f.write(" " + str(current_time))
163
  f.write("\n")
164
  f.close()
165
+ df.to_csv("{}.csv".format(st_hashed), index=False)
166
 
167
  return df
168