zlmqi commited on
Commit
e94cac0
1 Parent(s): 9bca90a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -53,8 +53,9 @@ class Chatbot:
53
  dataset_dir = Path("logs")
54
  dataset_dir.mkdir(parents=True, exist_ok=True)
55
  self.dataset_path = dataset_dir / f"chat_log_{uuid4()}.json"
 
56
 
57
- scheduler = CommitScheduler(
58
  repo_id="index",
59
  repo_type="dataset",
60
  folder_path=dataset_dir,
@@ -102,7 +103,7 @@ class Chatbot:
102
  self.chat_history.append(dictionary)
103
 
104
  def save_chat_history(self):
105
- with scheduler.lock:
106
  with self.dataset_path.open("a") as f:
107
  json.dump(self.chat_history, f)
108
  f.write("\n")
 
53
  dataset_dir = Path("logs")
54
  dataset_dir.mkdir(parents=True, exist_ok=True)
55
  self.dataset_path = dataset_dir / f"chat_log_{uuid4()}.json"
56
+
57
 
58
+ self.scheduler = CommitScheduler(
59
  repo_id="index",
60
  repo_type="dataset",
61
  folder_path=dataset_dir,
 
103
  self.chat_history.append(dictionary)
104
 
105
  def save_chat_history(self):
106
+ with self.scheduler.lock:
107
  with self.dataset_path.open("a") as f:
108
  json.dump(self.chat_history, f)
109
  f.write("\n")