wenkai commited on
Commit
6789f7b
ยท
verified ยท
1 Parent(s): 3584f8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -16
app.py CHANGED
@@ -245,17 +245,31 @@ css = """
245
  border: 1px solid #ccc;
246
  }
247
  /* Style for the upvote button */
248
- .upvote-button, .downvote-button, .submit-btn {
249
- flex: 1; /* Allow buttons to grow equally */
250
- margin: 0 5px; /* Add some margin for spacing */
251
- max-width: calc(50% - 10px); /* Ensure they are half width minus margin */
252
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  .feedback {
254
  width: 40px; /* Set button width */
255
  height: 40px; /* Set button height */
256
  font-size: 16px; /* Set font size */
257
  background-color: #f8d7da; /* Set background color */
258
- }
259
  """
260
 
261
  with gr.Blocks(css=css) as demo:
@@ -266,20 +280,33 @@ with gr.Blocks(css=css) as demo:
266
  with gr.Column():
267
  input_protein = gr.Textbox(type="text", label="Upload sequence")
268
  prompt = gr.Textbox(type="text", label="Taxonomy Prompt (Optional)")
269
- submit_btn = gr.Button(value="Submit")
270
  with gr.Column():
271
  # output_text = gr.Textbox(label="Output Text")
272
  with gr.Accordion('Prediction:', open=True):
273
  output_markdown = gr.Markdown(label="Output")
274
- with gr.Row():
275
- with gr.Column():
276
- upvote_button = gr.Button("๐Ÿ‘")
277
- with gr.Column():
278
- downvote_button = gr.Button("๐Ÿ‘Ž")
279
- with gr.Column():
280
- vote_markdown = gr.Markdown(label="Output")
281
- with gr.Column():
282
- vote_temp = gr.Markdown()
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  with gr.Row():
284
  inputs = gr.Textbox(type="text", label="Your feedback")
285
  feedback_markdown = gr.Markdown(label="Output")
 
245
  border: 1px solid #ccc;
246
  }
247
  /* Style for the upvote button */
248
+ .submit-btn {
249
+ width: 100%;
250
+ }
251
+
252
+ .vote-container {
253
+ display: flex;
254
+ width: 100%;
255
+ gap: 10px;
256
+ }
257
+
258
+ .vote-buttons {
259
+ display: flex;
260
+ width: 100%;
261
+ gap: 10px;
262
+ }
263
+
264
+ .vote-btn {
265
+ flex: 1;
266
+ }
267
  .feedback {
268
  width: 40px; /* Set button width */
269
  height: 40px; /* Set button height */
270
  font-size: 16px; /* Set font size */
271
  background-color: #f8d7da; /* Set background color */
272
+ }
273
  """
274
 
275
  with gr.Blocks(css=css) as demo:
 
280
  with gr.Column():
281
  input_protein = gr.Textbox(type="text", label="Upload sequence")
282
  prompt = gr.Textbox(type="text", label="Taxonomy Prompt (Optional)")
283
+ submit_btn = gr.Button(value="Submit", elem_classes=["submit-btn"])
284
  with gr.Column():
285
  # output_text = gr.Textbox(label="Output Text")
286
  with gr.Accordion('Prediction:', open=True):
287
  output_markdown = gr.Markdown(label="Output")
288
+ # with gr.Row():
289
+ # with gr.Column():
290
+ # upvote_button = gr.Button("๐Ÿ‘")
291
+ # with gr.Column():
292
+ # downvote_button = gr.Button("๐Ÿ‘Ž")
293
+ # with gr.Column():
294
+ # vote_markdown = gr.Markdown(label="Output")
295
+ # with gr.Column():
296
+ # vote_temp = gr.Markdown()
297
+ # ๆŠ•็ฅจๆŒ‰้’ฎๅ’Œๅ†…ๅฎน็š„ๅฎนๅ™จ
298
+ with gr.Row(elem_classes=["vote-container"]):
299
+ # ๆŠ•็ฅจๆŒ‰้’ฎ็ป„
300
+ with gr.Column(scale=1, elem_classes=["vote-buttons"]):
301
+ with gr.Row():
302
+ upvote_button = gr.Button("๐Ÿ‘", elem_classes=["vote-btn"])
303
+ downvote_button = gr.Button("๐Ÿ‘Ž", elem_classes=["vote-btn"])
304
+
305
+ # ๆŠ•็ฅจ็›ธๅ…ณๅ†…ๅฎน
306
+ with gr.Column(scale=3, elem_classes=["vote-content"]):
307
+ with gr.Row():
308
+ vote_markdown = gr.Markdown(label="Output")
309
+ vote_temp = gr.Markdown()
310
  with gr.Row():
311
  inputs = gr.Textbox(type="text", label="Your feedback")
312
  feedback_markdown = gr.Markdown(label="Output")