wenkai commited on
Commit
8df133a
·
verified ·
1 Parent(s): 181fc76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -196,6 +196,11 @@ def generate_caption(protein, prompt):
196
  return res_str
197
 
198
 
 
 
 
 
 
199
  # Define the FAPM interface
200
  description = """Quick demonstration of the FAPM model for protein function prediction. Upload an protein sequence to generate a function description. Modify the Prompt to provide the taxonomy information.
201
 
@@ -251,6 +256,11 @@ with gr.Blocks(css=css) as demo:
251
  label='Try examples'
252
  )
253
  submit_btn.click(generate_caption, [input_protein, prompt], [output_markdown])
254
-
 
 
 
 
 
255
  demo.launch(debug=True)
256
 
 
196
  return res_str
197
 
198
 
199
+ def save_feedback(inputs):
200
+ with open('feedback.txt', 'a+') as f:
201
+ f.write(inputs+'\n')
202
+
203
+
204
  # Define the FAPM interface
205
  description = """Quick demonstration of the FAPM model for protein function prediction. Upload an protein sequence to generate a function description. Modify the Prompt to provide the taxonomy information.
206
 
 
256
  label='Try examples'
257
  )
258
  submit_btn.click(generate_caption, [input_protein, prompt], [output_markdown])
259
+ with gr.Tab(label="Your feedback"):
260
+ with gr.Row():
261
+ with gr.Column():
262
+ inputs = gr.Textbox(type="text")
263
+ feedback_btn = gr.Button(value="Submit")
264
+ feedback_btn.click(save_feedback, [inputs])
265
  demo.launch(debug=True)
266