Commit
·
df647c5
1
Parent(s):
7f470bc
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,12 +83,12 @@ def huggingface_result_page(paragraph):
|
|
| 83 |
}
|
| 84 |
print("LENGTH of results ====> ",str(len(results)))
|
| 85 |
print("LENGTH of sen_list ====> ",str(len(temp_result_dict)))
|
| 86 |
-
save_data_and_sendmail(sen_list,results)
|
| 87 |
return pd.DataFrame(result)
|
| 88 |
else:
|
| 89 |
raise gr.Error("Please enter text in inputbox!!!!")
|
| 90 |
|
| 91 |
-
def save_data_and_sendmail(sen_list,results):
|
| 92 |
try:
|
| 93 |
print("welcome")
|
| 94 |
ip_address = ''
|
|
@@ -97,7 +97,7 @@ def save_data_and_sendmail(sen_list,results):
|
|
| 97 |
print(ip_address)
|
| 98 |
location = get_location(ip_address)
|
| 99 |
print(location)
|
| 100 |
-
add_csv = [
|
| 101 |
with open(DATA_FILE, "a") as f:
|
| 102 |
writer = csv.writer(f)
|
| 103 |
# write the data
|
|
|
|
| 83 |
}
|
| 84 |
print("LENGTH of results ====> ",str(len(results)))
|
| 85 |
print("LENGTH of sen_list ====> ",str(len(temp_result_dict)))
|
| 86 |
+
save_data_and_sendmail(sen_list,results,result,paragraph)
|
| 87 |
return pd.DataFrame(result)
|
| 88 |
else:
|
| 89 |
raise gr.Error("Please enter text in inputbox!!!!")
|
| 90 |
|
| 91 |
+
def save_data_and_sendmail(sen_list,results,result,paragraph):
|
| 92 |
try:
|
| 93 |
print("welcome")
|
| 94 |
ip_address = ''
|
|
|
|
| 97 |
print(ip_address)
|
| 98 |
location = get_location(ip_address)
|
| 99 |
print(location)
|
| 100 |
+
add_csv = [paragraph,result,ip_address,location]
|
| 101 |
with open(DATA_FILE, "a") as f:
|
| 102 |
writer = csv.writer(f)
|
| 103 |
# write the data
|