Instructions to use throsturx/bihmoe-poc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use throsturx/bihmoe-poc with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("throsturx/bihmoe-poc", dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| from __future__ import annotations | |
| import os | |
| import random | |
| import numpy as np | |
| def set_seed(seed: int) -> None: | |
| random.seed(seed) | |
| np.random.seed(seed) | |
| os.environ["PYTHONHASHSEED"] = str(seed) | |
| try: | |
| import torch | |
| torch.manual_seed(seed) | |
| torch.cuda.manual_seed_all(seed) | |
| except Exception: | |
| pass | |
| def count_params(module) -> int: | |
| return sum(p.numel() for p in module.parameters()) | |
| def fmt_bytes(n: int) -> str: | |
| for unit in ["B","KB","MB","GB","TB"]: | |
| if n < 1024: | |
| return f"{n:.1f}{unit}" | |
| n /= 1024 | |
| return f"{n:.1f}PB" | |