wenkai commited on
Commit
a8642e4
Β·
verified Β·
1 Parent(s): d638ffc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -4
app.py CHANGED
@@ -246,6 +246,31 @@ css = """
246
  }
247
  """
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  with gr.Blocks(css=css) as demo:
250
  gr.Markdown(description)
251
  vote_id = gr.State(0)
@@ -259,8 +284,10 @@ with gr.Blocks(css=css) as demo:
259
  # output_text = gr.Textbox(label="Output Text")
260
  with gr.Accordion('Prediction:', open=True):
261
  output_markdown = gr.Markdown(label="Output")
262
- upvote_button = gr.Button("πŸ‘")
263
- downvote_button = gr.Button("πŸ‘Ž")
 
 
264
 
265
  with gr.Column():
266
  inputs = gr.Textbox(type="text")
@@ -283,9 +310,12 @@ with gr.Blocks(css=css) as demo:
283
  label='Try examples'
284
  )
285
  submit_btn.click(generate_caption, [input_protein, prompt], [output_markdown])
286
- upvote_button.click(upvote, vote_id, None)
287
- downvote_button.click(downvote, vote_id, None)
288
  feedback_btn.click(save_feedback, [inputs], [feedback_markdown])
289
 
290
  demo.launch(debug=True)
291
 
 
 
 
 
246
  }
247
  """
248
 
249
+ css = """
250
+ #output {
251
+ height: 500px;
252
+ overflow: auto;
253
+ border: 1px solid #ccc;
254
+ }
255
+ /* Style for the upvote button */
256
+ .upvote-button {
257
+ width: 500px; /* Set button width */
258
+ height: 50px; /* Set button height */
259
+ font-size: 20px; /* Set font size */
260
+ background-color: #d4edda; /* Set background color */
261
+ border-radius: 5px; /* Rounded corners */
262
+ }
263
+
264
+ /* Style for the downvote button */
265
+ .downvote-button {
266
+ width: 50px; /* Set button width */
267
+ height: 50px; /* Set button height */
268
+ font-size: 20px; /* Set font size */
269
+ background-color: #f8d7da; /* Set background color */
270
+ border-radius: 5px; /* Rounded corners */
271
+ }
272
+ """
273
+
274
  with gr.Blocks(css=css) as demo:
275
  gr.Markdown(description)
276
  vote_id = gr.State(0)
 
284
  # output_text = gr.Textbox(label="Output Text")
285
  with gr.Accordion('Prediction:', open=True):
286
  output_markdown = gr.Markdown(label="Output")
287
+ with gr.Row():
288
+ upvote_button = gr.Button("πŸ‘", elem_classes="upvote-button")
289
+ downvote_button = gr.Button("πŸ‘Ž", elem_classes="downvote-button")
290
+ vote_markdown = gr.Markdown(label="Output")
291
 
292
  with gr.Column():
293
  inputs = gr.Textbox(type="text")
 
310
  label='Try examples'
311
  )
312
  submit_btn.click(generate_caption, [input_protein, prompt], [output_markdown])
313
+ upvote_button.click(upvote, vote_id, vote_markdown)
314
+ downvote_button.click(downvote, vote_id, vote_markdown)
315
  feedback_btn.click(save_feedback, [inputs], [feedback_markdown])
316
 
317
  demo.launch(debug=True)
318
 
319
+
320
+ demo.launch(debug=True)
321
+