Spaces:
Running
Running
pragnakalp
commited on
Commit
•
0b65517
1
Parent(s):
1befc82
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ from huggingface_hub import Repository
|
|
20 |
import huggingface_hub
|
21 |
import socket
|
22 |
|
|
|
23 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
24 |
DATASET_NAME = "bert_based_ner_dataset"
|
25 |
DATASET_REPO_URL = f"https://huggingface.co/datasets/pragnakalp/{DATASET_NAME}"
|
@@ -68,8 +69,8 @@ k = 0
|
|
68 |
# print(result)
|
69 |
# return result
|
70 |
|
71 |
-
def get_location(
|
72 |
-
ip=
|
73 |
# ip=str(request.remote_addr)
|
74 |
req_data={
|
75 |
"ip":ip,
|
@@ -133,9 +134,10 @@ def save_data_and_sendmail(article,output):
|
|
133 |
# ip_address = ''
|
134 |
# ip_address = get_device_ip_address()
|
135 |
ip_address=str(request.remote_addr)
|
|
|
136 |
location = get_location(ip_address)
|
137 |
# location = get_location(ip_address)
|
138 |
-
print(ip_address)
|
139 |
add_csv = [article,output,ip_address]
|
140 |
with open(DATA_FILE, "a") as f:
|
141 |
writer = csv.writer(f)
|
|
|
20 |
import huggingface_hub
|
21 |
import socket
|
22 |
|
23 |
+
|
24 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
25 |
DATASET_NAME = "bert_based_ner_dataset"
|
26 |
DATASET_REPO_URL = f"https://huggingface.co/datasets/pragnakalp/{DATASET_NAME}"
|
|
|
69 |
# print(result)
|
70 |
# return result
|
71 |
|
72 |
+
def get_location(ip_address):
|
73 |
+
ip=ip_address
|
74 |
# ip=str(request.remote_addr)
|
75 |
req_data={
|
76 |
"ip":ip,
|
|
|
134 |
# ip_address = ''
|
135 |
# ip_address = get_device_ip_address()
|
136 |
ip_address=str(request.remote_addr)
|
137 |
+
print(ip_address)
|
138 |
location = get_location(ip_address)
|
139 |
# location = get_location(ip_address)
|
140 |
+
# print(ip_address)
|
141 |
add_csv = [article,output,ip_address]
|
142 |
with open(DATA_FILE, "a") as f:
|
143 |
writer = csv.writer(f)
|