Instructions to use togethercomputer/m2-bert-80M-8k-retrieval with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use togethercomputer/m2-bert-80M-8k-retrieval with Transformers:
# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("togethercomputer/m2-bert-80M-8k-retrieval", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
How to run on GPU?
#6
by Wizd - opened
I found it runs on CPU by default.
I found it runs on CPU by default.
model = AutoModelForSequenceClassification.from_pretrained(
pretrained_model_name_or_path=model_path,
trust_remote_code=True,
)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.eval().to(device)