Spaces:
Running
Running
kabudadada commited on
Commit ·
fbf610d
1
Parent(s): 39a8811
fix(startup): avoid importing inverse_folding at module load; use local esm/source; add scipy
Browse files
esm/mcp_output/mcp_plugin/mcp_service.py
CHANGED
|
@@ -5,7 +5,7 @@ source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__fil
|
|
| 5 |
sys.path.insert(0, source_path)
|
| 6 |
|
| 7 |
from fastmcp import FastMCP
|
| 8 |
-
from esm import pretrained, data,
|
| 9 |
|
| 10 |
mcp = FastMCP("esm_service")
|
| 11 |
|
|
@@ -95,6 +95,8 @@ def generate_fixed_backbone(
|
|
| 95 |
dict: success/result/error. result contains { sampled_sequences, recovery (if native available) }
|
| 96 |
"""
|
| 97 |
try:
|
|
|
|
|
|
|
| 98 |
import torch
|
| 99 |
model_obj, _alphabet = pretrained.esm_if1_gvp4_t16_142M_UR50()
|
| 100 |
model_obj = model_obj.eval()
|
|
|
|
| 5 |
sys.path.insert(0, source_path)
|
| 6 |
|
| 7 |
from fastmcp import FastMCP
|
| 8 |
+
from esm import pretrained, data, model # type: ignore
|
| 9 |
|
| 10 |
mcp = FastMCP("esm_service")
|
| 11 |
|
|
|
|
| 95 |
dict: success/result/error. result contains { sampled_sequences, recovery (if native available) }
|
| 96 |
"""
|
| 97 |
try:
|
| 98 |
+
# Lazy import to avoid requiring torch_geometric unless needed
|
| 99 |
+
from esm import inverse_folding # type: ignore
|
| 100 |
import torch
|
| 101 |
model_obj, _alphabet = pretrained.esm_if1_gvp4_t16_142M_UR50()
|
| 102 |
model_obj = model_obj.eval()
|