Update app.py
Browse files
app.py
CHANGED
|
@@ -94,8 +94,12 @@ fs = HfFileSystem(token=os.environ["acces_token"])
|
|
| 94 |
|
| 95 |
def write_to_file(file_name,content):
|
| 96 |
file_path = f"spaces/mgreg555/docs_chat/" + file_name
|
| 97 |
-
with fs.open(file_path, "
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
# Example usage
|
| 101 |
|
|
|
|
| 94 |
|
| 95 |
def write_to_file(file_name,content):
|
| 96 |
file_path = f"spaces/mgreg555/docs_chat/" + file_name
|
| 97 |
+
with fs.open(file_path, "r") as file_old:
|
| 98 |
+
content_old = file_old.read()
|
| 99 |
+
print(content_old)
|
| 100 |
+
|
| 101 |
+
with fs.open(file_path, "w") as file:
|
| 102 |
+
file.write(f"{content_old}\n" + content)
|
| 103 |
|
| 104 |
# Example usage
|
| 105 |
|