mirror of
https://github.com/evolutionaryscale/esm.git
synced 2026-06-04 17:14:23 +08:00
Fix imports in tools notebooks (#103)
This commit is contained in:
@@ -6,13 +6,13 @@ class StructureTokenizer(EsmTokenizerBase):
|
||||
"""A convenince class for accessing special token ids of
|
||||
the StructureTokenEncoder and StructureTokenDecoder."""
|
||||
|
||||
def __init__(self, cookbook_size: int = C.VQVAE_CODEBOOK_SIZE):
|
||||
def __init__(self, codebook_size: int = C.VQVAE_CODEBOOK_SIZE):
|
||||
self.vq_vae_special_tokens = {
|
||||
"MASK": cookbook_size,
|
||||
"EOS": cookbook_size + 1,
|
||||
"BOS": cookbook_size + 2,
|
||||
"PAD": cookbook_size + 3,
|
||||
"CHAINBREAK": cookbook_size + 4,
|
||||
"MASK": codebook_size,
|
||||
"EOS": codebook_size + 1,
|
||||
"BOS": codebook_size + 2,
|
||||
"PAD": codebook_size + 3,
|
||||
"CHAINBREAK": codebook_size + 4,
|
||||
}
|
||||
|
||||
def mask_token(self) -> str:
|
||||
|
||||
@@ -33,11 +33,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"import nest_asyncio\n",
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.generation import create_generation_ui\n",
|
||||
"from esm.widgets.views.login import create_login_ui\n",
|
||||
"\n",
|
||||
"nest_asyncio.apply()"
|
||||
]
|
||||
@@ -57,6 +53,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"\n",
|
||||
"huggingface_hub.login()"
|
||||
]
|
||||
},
|
||||
@@ -67,6 +65,17 @@
|
||||
"### Inference Settings"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.generation import create_generation_ui\n",
|
||||
"from esm.widgets.views.login import create_login_ui"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -95,13 +104,6 @@
|
||||
"client = client_init()\n",
|
||||
"create_generation_ui(client)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
@@ -33,13 +33,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"import nest_asyncio\n",
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.inverse_folding import (\n",
|
||||
" create_inverse_folding_ui,\n",
|
||||
")\n",
|
||||
"from esm.widgets.views.login import create_login_ui\n",
|
||||
"\n",
|
||||
"nest_asyncio.apply()"
|
||||
]
|
||||
@@ -59,6 +53,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"\n",
|
||||
"huggingface_hub.login()"
|
||||
]
|
||||
},
|
||||
@@ -69,6 +65,19 @@
|
||||
"### Inference Settings"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.inverse_folding import (\n",
|
||||
" create_inverse_folding_ui,\n",
|
||||
")\n",
|
||||
"from esm.widgets.views.login import create_login_ui"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
||||
@@ -33,11 +33,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"import nest_asyncio\n",
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.login import create_login_ui\n",
|
||||
"from esm.widgets.views.prediction import create_prediction_ui\n",
|
||||
"\n",
|
||||
"nest_asyncio.apply()"
|
||||
]
|
||||
@@ -57,6 +53,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import huggingface_hub\n",
|
||||
"\n",
|
||||
"huggingface_hub.login()"
|
||||
]
|
||||
},
|
||||
@@ -67,6 +65,17 @@
|
||||
"### Inference Settings"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from esm.widgets.utils.types import ClientInitContainer\n",
|
||||
"from esm.widgets.views.login import create_login_ui\n",
|
||||
"from esm.widgets.views.prediction import create_prediction_ui"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -109,18 +118,6 @@
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.0"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user