Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -221,6 +221,10 @@ MODEL_OPTIONS = [
|
|
| 221 |
"facebook/esm2_t33_650M_UR50D",
|
| 222 |
] # models users can choose from
|
| 223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
# Load the data from pickle files (replace with your local paths)
|
| 226 |
with open("./datasets/train_sequences_chunked_by_family.pkl", "rb") as f:
|
|
@@ -309,33 +313,35 @@ with demo:
|
|
| 309 |
gr.Markdown("# DEMO FOR ESM2Bind")
|
| 310 |
#gr.Textbox(dubug_result)
|
| 311 |
|
|
|
|
| 312 |
with gr.Tab("Finetune Pre-trained Model"):
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
|
|
|
| 339 |
finetune_button.click(
|
| 340 |
fn = train_function_no_sweeps,
|
| 341 |
inputs=[base_model_name], #finetune_dataset_name],
|
|
|
|
| 221 |
"facebook/esm2_t33_650M_UR50D",
|
| 222 |
] # models users can choose from
|
| 223 |
|
| 224 |
+
PEFT_MODEL_OPTIONS = [
|
| 225 |
+
"AmelieSchreiber/esm2_t12_35M_lora_binding_sites_v2_cp3",
|
| 226 |
+
] # finetuned models
|
| 227 |
+
|
| 228 |
|
| 229 |
# Load the data from pickle files (replace with your local paths)
|
| 230 |
with open("./datasets/train_sequences_chunked_by_family.pkl", "rb") as f:
|
|
|
|
| 313 |
gr.Markdown("# DEMO FOR ESM2Bind")
|
| 314 |
#gr.Textbox(dubug_result)
|
| 315 |
|
| 316 |
+
|
| 317 |
with gr.Tab("Finetune Pre-trained Model"):
|
| 318 |
+
gr.Markdown("## Finetune Pre-trained Model")
|
| 319 |
+
with gr.Column():
|
| 320 |
+
gr.Markdown("## Select a base model")
|
| 321 |
+
gr.Markdown(
|
| 322 |
+
""" Pick a base model and press **Finetune Pre-trained Model!"""
|
| 323 |
+
)
|
| 324 |
+
with gr.Row():
|
| 325 |
+
with gr.Column(scale=0.5, variant="compact"):
|
| 326 |
+
base_model_name = gr.Dropdown(
|
| 327 |
+
choices=MODEL_OPTIONS,
|
| 328 |
+
value=MODEL_OPTIONS[0],
|
| 329 |
+
label="Base Model Name",
|
| 330 |
+
interactive = True,
|
| 331 |
+
)
|
| 332 |
+
finetune_button = gr.Button(
|
| 333 |
+
value="Finetune Pre-trained Model",
|
| 334 |
+
interactive=True,
|
| 335 |
+
variant="primary",
|
| 336 |
+
)
|
| 337 |
+
finetune_output_text = gr.Textbox(
|
| 338 |
+
lines=1,
|
| 339 |
+
max_lines=12,
|
| 340 |
+
label="Finetune Status",
|
| 341 |
+
placeholder="Finetune Status Shown Here",
|
| 342 |
+
)
|
| 343 |
+
|
| 344 |
+
# "Finetune Pre-trained Model" actions
|
| 345 |
finetune_button.click(
|
| 346 |
fn = train_function_no_sweeps,
|
| 347 |
inputs=[base_model_name], #finetune_dataset_name],
|