Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,6 +34,8 @@ print(f"Repo local_dir: {repo.local_dir}")
|
|
| 34 |
print(f"Repo files: {os.listdir(repo.local_dir)}")
|
| 35 |
print (f"Index file:{INDEX_FILENAME}")
|
| 36 |
|
|
|
|
|
|
|
| 37 |
def generate_text() -> str:
|
| 38 |
with open(DATA_FILE) as file:
|
| 39 |
text = ""
|
|
@@ -52,6 +54,15 @@ def store_message(chatinput: str, chatresponse: str):
|
|
| 52 |
print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
|
| 53 |
|
| 54 |
#need to find a way to push back to dataset repo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
return generate_text()
|
| 57 |
|
|
|
|
| 34 |
print(f"Repo files: {os.listdir(repo.local_dir)}")
|
| 35 |
print (f"Index file:{INDEX_FILENAME}")
|
| 36 |
|
| 37 |
+
|
| 38 |
+
|
| 39 |
def generate_text() -> str:
|
| 40 |
with open(DATA_FILE) as file:
|
| 41 |
text = ""
|
|
|
|
| 54 |
print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
|
| 55 |
|
| 56 |
#need to find a way to push back to dataset repo
|
| 57 |
+
|
| 58 |
+
# Add the file you want to push to the repository
|
| 59 |
+
repo.add(DATA_FILE)
|
| 60 |
+
|
| 61 |
+
# Commit the changes to the repository
|
| 62 |
+
repo.commit('Added new file')
|
| 63 |
+
|
| 64 |
+
# Push the commit to the remote repository
|
| 65 |
+
repo.push(repo_url)
|
| 66 |
|
| 67 |
return generate_text()
|
| 68 |
|