Instructions to use AIuser2222/Cyn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use AIuser2222/Cyn with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("<base-model-id>") model.load_adapter("AIuser2222/Cyn", set_active=True) - Notebooks
- Google Colab
- Kaggle
Download app.py from AIuser2222/Cyn: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/AIuser2222/Cyn/resolve/main/app.py
- Command line
-
hf download hf://AIuser2222/Cyn/app.py
-
curl -L -o app.py https://huggingface.co/AIuser2222/Cyn/resolve/main/app.py
458 Bytes
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| import torch | |
| def predict(text): | |
| tokenizer = AutoTokenizer.from_pretrained("username/model_name") | |
| model = AutoModelForSequenceClassification.from_pretrained("username/model_name") | |
| inputs = tokenizer(text, return_tensors="pt") | |
| with torch.no_grad(): | |
| logits = model(**inputs).logits | |
| predicted_class_id = logits.argmax().item() | |
| return predicted_class_id | |