davda54 commited on
Commit
9c65c2d
1 Parent(s): ecf390c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -57,10 +57,11 @@ dataset = Repository(
57
  def add_anonymous_usage_log(path):
58
  global dataset
59
  try:
 
60
  with open(path, "a") as f:
61
  line = json.dumps(str(datetime.now()), ensure_ascii=False)
62
  f.write(f"{line}\n")
63
- dataset.push_to_hub()
64
 
65
  except:
66
  shutil.rmtree("data")
@@ -70,7 +71,7 @@ def add_anonymous_usage_log(path):
70
  with open(path, "a") as f:
71
  line = json.dumps(str(datetime.now()), ensure_ascii=False)
72
  f.write(f"{line}\n")
73
- dataset.push_to_hub()
74
 
75
 
76
  class BatchStreamer(TextIteratorStreamer):
 
57
  def add_anonymous_usage_log(path):
58
  global dataset
59
  try:
60
+ dataset.git_pull()
61
  with open(path, "a") as f:
62
  line = json.dumps(str(datetime.now()), ensure_ascii=False)
63
  f.write(f"{line}\n")
64
+ dataset.push_to_hub(blocking=False)
65
 
66
  except:
67
  shutil.rmtree("data")
 
71
  with open(path, "a") as f:
72
  line = json.dumps(str(datetime.now()), ensure_ascii=False)
73
  f.write(f"{line}\n")
74
+ dataset.push_to_hub(blocking=False)
75
 
76
 
77
  class BatchStreamer(TextIteratorStreamer):