Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,14 +27,14 @@ all_cats = dataset["train"]["all_cats"]
|
|
27 |
|
28 |
print("The data has loaded")
|
29 |
|
30 |
-
# for saving a log
|
31 |
DATASET_REPO_URL = "https://huggingface.co/datasets/acd424/tribunal_data"
|
32 |
DATA_FILENAME = "queries_and_responces.txt"
|
33 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
34 |
repo = Repository(
|
35 |
local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=access_token_1
|
36 |
)
|
37 |
-
|
38 |
################### Functions ##########################
|
39 |
|
40 |
|
@@ -96,14 +96,14 @@ def produce_tribunal_out(query, corpus=files, tribunal_embeddings=embeddings):
|
|
96 |
)
|
97 |
# get time
|
98 |
time_now = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
|
99 |
-
|
100 |
-
# write to file
|
101 |
|
102 |
with open(DATA_FILE, "a") as f:
|
103 |
f.write(f"{time_now}|{query}\n")
|
104 |
commit_url = repo.push_to_hub()
|
105 |
print(commit_url)
|
106 |
-
|
107 |
return gr.update(value=context_string)
|
108 |
|
109 |
|
|
|
27 |
|
28 |
print("The data has loaded")
|
29 |
|
30 |
+
'''# for saving a log
|
31 |
DATASET_REPO_URL = "https://huggingface.co/datasets/acd424/tribunal_data"
|
32 |
DATA_FILENAME = "queries_and_responces.txt"
|
33 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
34 |
repo = Repository(
|
35 |
local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=access_token_1
|
36 |
)
|
37 |
+
'''
|
38 |
################### Functions ##########################
|
39 |
|
40 |
|
|
|
96 |
)
|
97 |
# get time
|
98 |
time_now = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
|
99 |
+
print(f"{time_now}|{query}\n")
|
100 |
+
'''# write to file
|
101 |
|
102 |
with open(DATA_FILE, "a") as f:
|
103 |
f.write(f"{time_now}|{query}\n")
|
104 |
commit_url = repo.push_to_hub()
|
105 |
print(commit_url)
|
106 |
+
'''
|
107 |
return gr.update(value=context_string)
|
108 |
|
109 |
|