Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +36 -33
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -158,46 +158,48 @@ def run_part2(pdb_id, uploaded_esm_file):
|
|
| 158 |
|
| 159 |
# --- GRADIO INTERFACE ---
|
| 160 |
|
| 161 |
-
# 1.
|
| 162 |
-
|
| 163 |
-
primary_hue="
|
| 164 |
-
secondary_hue="
|
| 165 |
neutral_hue="slate",
|
| 166 |
-
font=[gr.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui"],
|
| 167 |
).set(
|
| 168 |
-
#
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
button_primary_text_color="white",
|
| 174 |
-
border_color_primary="*neutral_200",
|
| 175 |
)
|
| 176 |
|
| 177 |
-
# 2.
|
| 178 |
biohub_css = """
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
}
|
|
|
|
|
|
|
| 182 |
#biohub-header {
|
| 183 |
-
|
| 184 |
-
padding:
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
margin-bottom: 20px;
|
| 189 |
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
| 190 |
-
}
|
| 191 |
-
.gr-box {
|
| 192 |
-
border-radius: 12px !important;
|
| 193 |
-
border: 1px solid #e2e8f0 !important;
|
| 194 |
}
|
| 195 |
-
footer {display: none !important;} /* Cleans up the portfolio look */
|
| 196 |
"""
|
| 197 |
|
| 198 |
-
with gr.Blocks(theme=
|
| 199 |
-
|
| 200 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
with gr.Tabs():
|
| 203 |
# TAB 1: GENERATIVE DESIGN
|
|
@@ -243,7 +245,7 @@ with gr.Blocks(theme=biohub_theme, css=biohub_css) as demo:
|
|
| 243 |
]
|
| 244 |
|
| 245 |
# This component ACTUALLY supports .pdb natively
|
| 246 |
-
protein_view = Molecule3D(label="3D Structure Viewer (Refined Shuttle)", reps=REPS)
|
| 247 |
|
| 248 |
with gr.Row():
|
| 249 |
esm_upload = gr.File(label="Upload ESM-Folded PDB", file_types=[".pdb"])
|
|
@@ -282,5 +284,6 @@ with gr.Blocks(theme=biohub_theme, css=biohub_css) as demo:
|
|
| 282 |
|
| 283 |
# Launch the app
|
| 284 |
if __name__ == "__main__":
|
| 285 |
-
#
|
| 286 |
-
demo.launch(
|
|
|
|
|
|
| 158 |
|
| 159 |
# --- GRADIO INTERFACE ---
|
| 160 |
|
| 161 |
+
# 1. Simple Dark Theme with Blue and Emerald Accents
|
| 162 |
+
dark_biohub = gr.themes.Base(
|
| 163 |
+
primary_hue="blue",
|
| 164 |
+
secondary_hue="emerald",
|
| 165 |
neutral_hue="slate",
|
|
|
|
| 166 |
).set(
|
| 167 |
+
body_background_fill="#0f172a",
|
| 168 |
+
block_background_fill="#1e293b",
|
| 169 |
+
body_text_color="#f1f5f9",
|
| 170 |
+
button_primary_background_fill="#10b981",
|
| 171 |
+
button_primary_text_color="#ffffff",
|
|
|
|
|
|
|
| 172 |
)
|
| 173 |
|
| 174 |
+
# 2. Targeted CSS for the 3D Viewer & Header
|
| 175 |
biohub_css = """
|
| 176 |
+
/* Remove the footer for a clean portfolio look */
|
| 177 |
+
footer {display: none !important;}
|
| 178 |
+
|
| 179 |
+
/* Fix the 3D viewer background to match the dark theme */
|
| 180 |
+
#molecule-viewer {
|
| 181 |
+
background-color: #111827 !important;
|
| 182 |
+
border: 1px solid #374151 !important;
|
| 183 |
+
border-radius: 12px;
|
| 184 |
}
|
| 185 |
+
|
| 186 |
+
/* Header Styling */
|
| 187 |
#biohub-header {
|
| 188 |
+
background: linear-gradient(135deg, #064e3b 0%, #1e40af 100%);
|
| 189 |
+
padding: 1.5rem;
|
| 190 |
+
border-radius: 12px;
|
| 191 |
+
border: 1px solid #10b981;
|
| 192 |
+
margin-bottom: 1rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
}
|
|
|
|
| 194 |
"""
|
| 195 |
|
| 196 |
+
with gr.Blocks(theme=dark_biohub, css=biohub_css) as demo:
|
| 197 |
+
# Header
|
| 198 |
+
gr.HTML("""
|
| 199 |
+
<div id='biohub-header'>
|
| 200 |
+
<h1 style='color: white; margin: 0;'>🧪 BroteinShake</h1>
|
| 201 |
+
</div>
|
| 202 |
+
""")
|
| 203 |
|
| 204 |
with gr.Tabs():
|
| 205 |
# TAB 1: GENERATIVE DESIGN
|
|
|
|
| 245 |
]
|
| 246 |
|
| 247 |
# This component ACTUALLY supports .pdb natively
|
| 248 |
+
protein_view = Molecule3D(label="3D Structure Viewer (Refined Shuttle)", reps=REPS, elem_id="molecule-viewer")
|
| 249 |
|
| 250 |
with gr.Row():
|
| 251 |
esm_upload = gr.File(label="Upload ESM-Folded PDB", file_types=[".pdb"])
|
|
|
|
| 284 |
|
| 285 |
# Launch the app
|
| 286 |
if __name__ == "__main__":
|
| 287 |
+
# FORCE DARK MODE: Add the theme toggle directly to the URL
|
| 288 |
+
demo.launch(server_port=7860)
|
| 289 |
+
# Visit: http://127.0.0.1:7860/?__theme=dark
|
requirements.txt
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
gradio==5.50.0
|
| 2 |
gradio_molecule3d
|
|
|
|
|
|
|
| 3 |
accelerate==1.12.0
|
| 4 |
backports.zstd
|
| 5 |
biopython==1.86
|
|
|
|
| 1 |
gradio==5.50.0
|
| 2 |
gradio_molecule3d
|
| 3 |
+
matplotlib
|
| 4 |
+
pandas
|
| 5 |
accelerate==1.12.0
|
| 6 |
backports.zstd
|
| 7 |
biopython==1.86
|