vpcom commited on
Commit
ac2cf4c
1 Parent(s): 2ba7b49

feat: add a thread to push every x sec

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -13,6 +13,8 @@ FORCE_PUSH = os.getenv("FORCE_PUSH")
13
  BOT_NAME = "PersianGPT-FT"
14
  PUSH_FREQUENCY = 60 # every minute
15
 
 
 
16
  repo = Repository(local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN)
17
 
18
  stop_sequences = [] #["<|endoftext|>",">"]
@@ -45,6 +47,9 @@ def asynchronous_push(f_stop):
45
  # call again in 60 seconds
46
  threading.Timer(PUSH_FREQUENCY, asynchronous_push, [f_stop]).start()
47
 
 
 
 
48
  def vote(data: gr.LikeData):
49
  if data.liked:
50
  print("You upvoted this response: " + data.value)
 
13
  BOT_NAME = "PersianGPT-FT"
14
  PUSH_FREQUENCY = 60 # every minute
15
 
16
+ DATA_FILENAME = "data.jsonl"
17
+ DATA_FILE = os.path.join("data", DATA_FILENAME)
18
  repo = Repository(local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN)
19
 
20
  stop_sequences = [] #["<|endoftext|>",">"]
 
47
  # call again in 60 seconds
48
  threading.Timer(PUSH_FREQUENCY, asynchronous_push, [f_stop]).start()
49
 
50
+ f_stop = threading.Event()
51
+ asynchronous_push(f_stop)
52
+
53
  def vote(data: gr.LikeData):
54
  if data.liked:
55
  print("You upvoted this response: " + data.value)