Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,11 +57,14 @@ def store_message(chatinput: str, chatresponse: str):
|
|
| 57 |
print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
|
| 58 |
|
| 59 |
#need to find a way to push back to dataset repo
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
return generate_text()
|
| 67 |
|
|
|
|
| 57 |
print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
|
| 58 |
|
| 59 |
#need to find a way to push back to dataset repo
|
| 60 |
+
HF_WRITE_TOKEN = os.environ.get("WRITE_TOKEN")
|
| 61 |
+
api.upload_file(
|
| 62 |
+
path_or_fileobj=DATA_FILE,
|
| 63 |
+
path_in_repo='logs/data.txt',
|
| 64 |
+
repo_id="peterpull/MediatorBot",
|
| 65 |
+
repo_type="dataset",
|
| 66 |
+
commit_message="Add new chat history",
|
| 67 |
+
use_auth_token=HF_WRITE_TOKEN)
|
| 68 |
|
| 69 |
return generate_text()
|
| 70 |
|