Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,8 @@ def send_result(l_output, r_output, prompt, pick):
|
|
45 |
writer = csv.writer(res_file)
|
46 |
row = [USER_ID,left,right,prompt,pick]
|
47 |
writer.writerow(row)
|
|
|
|
|
48 |
|
49 |
|
50 |
def get_matches(query, db_name="miread_contrastive"):
|
@@ -142,9 +144,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
142 |
api_name="arena")
|
143 |
l_btn.click(fn=lambda x,y,z: send_result(x,y,z,'left'),
|
144 |
inputs=[l_output,r_output,prompt],
|
|
|
145 |
api_name="feedleft")
|
146 |
r_btn.click(fn=lambda x,y,z: send_result(x,y,z,'right'),
|
147 |
inputs=[l_output,r_output,prompt],
|
|
|
148 |
api_name="feedright")
|
149 |
|
150 |
demo.launch(debug=True)
|
|
|
45 |
writer = csv.writer(res_file)
|
46 |
row = [USER_ID,left,right,prompt,pick]
|
47 |
writer.writerow(row)
|
48 |
+
new_prompt = get_article()
|
49 |
+
return gr.Textbox.update(value=new_prompt),gr.State.update(value=new_prompt)
|
50 |
|
51 |
|
52 |
def get_matches(query, db_name="miread_contrastive"):
|
|
|
144 |
api_name="arena")
|
145 |
l_btn.click(fn=lambda x,y,z: send_result(x,y,z,'left'),
|
146 |
inputs=[l_output,r_output,prompt],
|
147 |
+
outputs=[abst,],
|
148 |
api_name="feedleft")
|
149 |
r_btn.click(fn=lambda x,y,z: send_result(x,y,z,'right'),
|
150 |
inputs=[l_output,r_output,prompt],
|
151 |
+
outputs=[abst,prompt],
|
152 |
api_name="feedright")
|
153 |
|
154 |
demo.launch(debug=True)
|