Ym420 commited on
Commit
d91b456
·
verified ·
1 Parent(s): face98f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
2
  import joblib
3
  from huggingface_hub import hf_hub_download
4
  import numpy as np
 
 
5
 
6
  # --- Download model and scaler from your HF repo ---
7
  repo_id = "Ym420/terminator-classification"
@@ -123,10 +125,13 @@ def predict_terminator_table(sequence: str):
123
 
124
  # --- Gradio UI (no changes needed) ---
125
  custom_css = """
126
- footer, .footer { display: none !important; }
 
 
 
127
  """
128
 
129
- with gr.Blocks(css=custom_css) as demo:
130
  gr.Markdown("## Intrinsic Terminator Prediction\nEnter a DNA sequence to predict terminator probability.")
131
 
132
  seq = gr.Textbox(label="Enter DNA sequence")
@@ -134,6 +139,21 @@ with gr.Blocks(css=custom_css) as demo:
134
  with gr.Row():
135
  predict_btn = gr.Button("Predict", variant="primary", elem_id="predict-btn")
136
  clear_btn = gr.Button("Clear", elem_id="clear-btn")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  table = gr.Dataframe(headers=["Class","Confidence"], datatype=["str","number"], interactive=False)
139
 
 
2
  import joblib
3
  from huggingface_hub import hf_hub_download
4
  import numpy as np
5
+ import xgboost
6
+ import pandas as pd
7
 
8
  # --- Download model and scaler from your HF repo ---
9
  repo_id = "Ym420/terminator-classification"
 
125
 
126
  # --- Gradio UI (no changes needed) ---
127
  custom_css = """
128
+ /* Hide Gradio footer */
129
+ footer, .footer {
130
+ display: none !important;
131
+ }
132
  """
133
 
134
+ with gr.Blocks(css=custom_css, theme="default") as demo:
135
  gr.Markdown("## Intrinsic Terminator Prediction\nEnter a DNA sequence to predict terminator probability.")
136
 
137
  seq = gr.Textbox(label="Enter DNA sequence")
 
139
  with gr.Row():
140
  predict_btn = gr.Button("Predict", variant="primary", elem_id="predict-btn")
141
  clear_btn = gr.Button("Clear", elem_id="clear-btn")
142
+
143
+ gr.HTML(
144
+ """
145
+ <style>
146
+ #predict-btn {
147
+ width: 48%;
148
+ min-width: 120px;
149
+ }
150
+ #clear-btn {
151
+ width: 48%;
152
+ min-width: 100px;
153
+ }
154
+ </style>
155
+ """
156
+ )
157
 
158
  table = gr.Dataframe(headers=["Class","Confidence"], datatype=["str","number"], interactive=False)
159