Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,8 @@ if UseMemory:
|
|
40 |
)
|
41 |
except:
|
42 |
print("file not found")
|
43 |
-
repo = Repository(
|
44 |
-
|
45 |
-
)
|
46 |
|
47 |
def get_df(name: str):
|
48 |
dataset = load_dataset(str, split="train")
|
@@ -51,6 +50,10 @@ def get_df(name: str):
|
|
51 |
#def store_message(name: str, message: str) -> str:
|
52 |
def store_message(name: str, message: str):
|
53 |
if name and message:
|
|
|
|
|
|
|
|
|
54 |
with open(DATA_FILE, "a") as csvfile:
|
55 |
writer = csv.DictWriter(csvfile, fieldnames=[ "time", "message", "name", ])
|
56 |
writer.writerow(
|
|
|
40 |
)
|
41 |
except:
|
42 |
print("file not found")
|
43 |
+
repo = Repository(local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN)
|
44 |
+
repo.git_pull(rebase=True)
|
|
|
45 |
|
46 |
def get_df(name: str):
|
47 |
dataset = load_dataset(str, split="train")
|
|
|
50 |
#def store_message(name: str, message: str) -> str:
|
51 |
def store_message(name: str, message: str):
|
52 |
if name and message:
|
53 |
+
#repo.git_pull() # test repull to avoid out of sync rrepo error due to others commits
|
54 |
+
#repo = repo.git_pull(local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN) # test repull to avoid out of sync rrepo error due to others commits
|
55 |
+
#repo = Repository(local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN)
|
56 |
+
#
|
57 |
with open(DATA_FILE, "a") as csvfile:
|
58 |
writer = csv.DictWriter(csvfile, fieldnames=[ "time", "message", "name", ])
|
59 |
writer.writerow(
|