Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,18 +27,18 @@ if (!window.hasBeenRun) {
|
|
27 |
}
|
28 |
</script>
|
29 |
"""
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
def generate_html() -> str:
|
44 |
with open(DATA_FILE) as csvfile:
|
@@ -123,7 +123,7 @@ def chat(message, history):
|
|
123 |
history_useful = add_note_to_history(response, history_useful)
|
124 |
list_history = history_useful[0].split('</s> <s>')
|
125 |
history.append((list_history[-2], list_history[-1]))
|
126 |
-
|
127 |
return history, history
|
128 |
|
129 |
gr.Interface(
|
|
|
27 |
}
|
28 |
</script>
|
29 |
"""
|
30 |
+
try:
|
31 |
+
hf_hub_download(
|
32 |
+
repo_id=DATASET_REPO_ID,
|
33 |
+
filename=DATA_FILENAME,
|
34 |
+
cache_dir=DATA_DIRNAME,
|
35 |
+
force_filename=DATA_FILENAME
|
36 |
+
)
|
37 |
+
except:
|
38 |
+
print("file not found")
|
39 |
+
repo = Repository(
|
40 |
+
local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
41 |
+
)
|
42 |
|
43 |
def generate_html() -> str:
|
44 |
with open(DATA_FILE) as csvfile:
|
|
|
123 |
history_useful = add_note_to_history(response, history_useful)
|
124 |
list_history = history_useful[0].split('</s> <s>')
|
125 |
history.append((list_history[-2], list_history[-1]))
|
126 |
+
store_message(message, response) # Save to dataset
|
127 |
return history, history
|
128 |
|
129 |
gr.Interface(
|