Text Classification
Transformers
Safetensors
English
numo
feature-extraction
gemma4
custom-code
scientific-literature
study-design
decision-model
calibrated
local-inference
custom_code
Instructions to use mycel-ai/Numo-1-E2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mycel-ai/Numo-1-E2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mycel-ai/Numo-1-E2B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mycel-ai/Numo-1-E2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 960 Bytes
a2c0567 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | """Offline contracted scientific decision. MycelAI, Apache-2.0."""
import argparse
import json
from pathlib import Path
import torch
from transformers import AutoModel, AutoTokenizer
parser = argparse.ArgumentParser()
parser.add_argument("--model", type=Path, default=Path(__file__).resolve().parent)
parser.add_argument("--device", default="cuda")
args = parser.parse_args()
tokenizer = AutoTokenizer.from_pretrained(args.model, trust_remote_code=True, local_files_only=True)
model = AutoModel.from_pretrained(args.model, trust_remote_code=True,
local_files_only=True, dtype=torch.bfloat16)
model.prepare_for_inference(args.device)
result = model.predict(tokenizer, task="study_approach", text=(
"Title: A synthetic benchmark for sorting algorithms\n"
"Abstract: We compare algorithmic time complexity using generated arrays "
"and prove a bound for a new sorting method."))
print(json.dumps(result, indent=2))
|