Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
88 |
now = datetime.now()
|
89 |
current_time = now.strftime("%H:%M:%S")
|
90 |
try:
|
91 |
-
df = pd.read_csv("{}.csv".format(
|
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(
|
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 |
|