Instructions to use replicate/sonic-moe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/sonic-moe with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/sonic-moe", version=1) - Notebooks
- Google Colab
- Kaggle
Download build/torch-cuda/_ops_compat.py from replicate/sonic-moe: direct link, hf CLI and curl.
- Browser
- Download file 409 Bytes
-
https://huggingface.co/replicate/sonic-moe/resolve/main/build/torch-cuda/_ops_compat.py
- Command line
-
hf download hf://replicate/sonic-moe/build/torch-cuda/_ops_compat.py
-
curl -L -o _ops_compat.py https://huggingface.co/replicate/sonic-moe/resolve/main/build/torch-cuda/_ops_compat.py
409 Bytes
| """Compatibility helpers for op namespacing in source and built layouts.""" | |
| try: | |
| from ._ops import add_op_namespace_prefix as _generated_add_op_namespace_prefix | |
| except ImportError: | |
| def _generated_add_op_namespace_prefix(name: str) -> str: | |
| return name if "::" in name else f"sonicmoe::{name}" | |
| def add_op_namespace_prefix(name: str) -> str: | |
| return _generated_add_op_namespace_prefix(name) | |