Spaces:
Sleeping
Sleeping
Rename app.py to apps.py
Browse files- app.py → apps.py +1 -3
app.py → apps.py
RENAMED
@@ -1,7 +1,6 @@
|
|
1 |
from huggingface_hub import login
|
2 |
from esm.models.esm3 import ESM3
|
3 |
from esm.sdk.api import ESM3InferenceClient, ESMProtein, GenerationConfig
|
4 |
-
import spaces
|
5 |
import os
|
6 |
import gradio as gr
|
7 |
from gradio_molecule3d import Molecule3D
|
@@ -14,7 +13,7 @@ TOKEN = os.getenv("HF_TOKEN")
|
|
14 |
login(TOKEN)
|
15 |
|
16 |
# This will download the model weights and instantiate the model on your machine.
|
17 |
-
model: ESM3InferenceClient = ESM3.from_pretrained("esm3_sm_open_v1").to("
|
18 |
|
19 |
def read_mol(molpath):
|
20 |
with open(molpath, "r") as fp:
|
@@ -76,7 +75,6 @@ def molecule(input_pdb):
|
|
76 |
allow-top-navigation-by-user-activation allow-downloads" allowfullscreen=""
|
77 |
allowpaymentrequest="" frameborder="0" srcdoc='{x}'></iframe>"""
|
78 |
|
79 |
-
@spaces.GPU(duration=300)
|
80 |
def prediction(prompt, temperature):
|
81 |
protein = ESMProtein(sequence=prompt)
|
82 |
protein = model.generate(protein, GenerationConfig(track="sequence", num_steps=8, temperature=temperature))
|
|
|
1 |
from huggingface_hub import login
|
2 |
from esm.models.esm3 import ESM3
|
3 |
from esm.sdk.api import ESM3InferenceClient, ESMProtein, GenerationConfig
|
|
|
4 |
import os
|
5 |
import gradio as gr
|
6 |
from gradio_molecule3d import Molecule3D
|
|
|
13 |
login(TOKEN)
|
14 |
|
15 |
# This will download the model weights and instantiate the model on your machine.
|
16 |
+
model: ESM3InferenceClient = ESM3.from_pretrained("esm3_sm_open_v1").to("cpu")
|
17 |
|
18 |
def read_mol(molpath):
|
19 |
with open(molpath, "r") as fp:
|
|
|
75 |
allow-top-navigation-by-user-activation allow-downloads" allowfullscreen=""
|
76 |
allowpaymentrequest="" frameborder="0" srcdoc='{x}'></iframe>"""
|
77 |
|
|
|
78 |
def prediction(prompt, temperature):
|
79 |
protein = ESMProtein(sequence=prompt)
|
80 |
protein = model.generate(protein, GenerationConfig(track="sequence", num_steps=8, temperature=temperature))
|