Update app.py
Browse files
app.py
CHANGED
|
@@ -124,11 +124,17 @@ def talk(prompt, history):
|
|
| 124 |
historylog += f"{prompt} \n {response} "
|
| 125 |
print("history log")
|
| 126 |
print(str(historylog))
|
| 127 |
-
print("history log printed")
|
|
|
|
|
|
|
| 128 |
with open('file.txt', 'a') as data:
|
| 129 |
-
data.write(
|
| 130 |
-
data.seek(0)
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
# from huggingface_hub import HfApi
|
| 133 |
# api = HfApi()
|
| 134 |
# api.upload_file(
|
|
|
|
| 124 |
historylog += f"{prompt} \n {response} "
|
| 125 |
print("history log")
|
| 126 |
print(str(historylog))
|
| 127 |
+
print("history log string printed")
|
| 128 |
+
|
| 129 |
+
# write data to file
|
| 130 |
with open('file.txt', 'a') as data:
|
| 131 |
+
data.write(historylog)
|
|
|
|
| 132 |
|
| 133 |
+
# Read the contents of the file to display it.
|
| 134 |
+
with open('file.txt', 'r') as data:
|
| 135 |
+
print("History log printed:")
|
| 136 |
+
print(data.read())
|
| 137 |
+
|
| 138 |
# from huggingface_hub import HfApi
|
| 139 |
# api = HfApi()
|
| 140 |
# api.upload_file(
|