peterpull commited on
Commit
b7a6887
·
1 Parent(s): 08f7cb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -57,14 +57,14 @@ def store_message(chatinput: str, chatresponse: str):
57
  file.write(f"{datetime.now()},{chatinput},{chatresponse}\n")
58
  print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
59
 
60
- # Push back to hub every 2ND time the function is called
61
- if store_message.count_calls % 2 == 0:
62
- print("Pushing back to Hugging Face model hub")
63
- # Call the push_to_hub() function to push the changes to the hub
64
- push_to_hub(commit_message="Added new chat data")
65
- store_message.count_calls += 1
66
-
67
- return generate_text()
68
 
69
  store_message.count_calls = 1 #initiases the count at one. We want to count how many messages stored before pushing back to repo.
70
 
 
57
  file.write(f"{datetime.now()},{chatinput},{chatresponse}\n")
58
  print(f"Wrote to datafile: {datetime.now()},{chatinput},{chatresponse}\n")
59
 
60
+ # Push back to hub every N-th time the function is called
61
+ if store_message.count_calls % 1 == 0:
62
+ print("Pushing back to Hugging Face model hub")
63
+ # Call the push_to_hub() function to push the changes to the hub
64
+ push_to_hub(commit_message="Added new chat data") # Include commit_message parameter
65
+ store_message.count_calls += 1
66
+
67
+ return generate_text()
68
 
69
  store_message.count_calls = 1 #initiases the count at one. We want to count how many messages stored before pushing back to repo.
70