mgreg555 commited on
Commit
a53bc7d
·
verified ·
1 Parent(s): 0bec5d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -89,9 +89,20 @@ def chat(query,history):
89
 
90
  import gradio as gr
91
 
 
 
 
 
 
92
  def write_to_file(file_name, value):
93
  with open(file_name, 'a', encoding='utf-8') as file:
94
  file.write(find_previous_question(value) + ';' + str(value) + '\n')
 
 
 
 
 
 
95
 
96
  def vote(tmp, index_state, data: gr.LikeData):
97
  value_new = data.value
 
89
 
90
  import gradio as gr
91
 
92
+ from huggingface_hub import HfApi
93
+
94
+ api = HfApi()
95
+
96
+
97
  def write_to_file(file_name, value):
98
  with open(file_name, 'a', encoding='utf-8') as file:
99
  file.write(find_previous_question(value) + ';' + str(value) + '\n')
100
+ api.upload_file(
101
+ path_or_fileobj=file_name,
102
+ path_in_repo=file_name,
103
+ repo_id="mgreg555/docs_chat",
104
+ )
105
+
106
 
107
  def vote(tmp, index_state, data: gr.LikeData):
108
  value_new = data.value