import torch
from informer_models import InformerConfig, InformerForSequenceClassification
model = InformerForSequenceClassification.from_pretrained("BrachioLab/supernova-classification")
model.to(device)
model.eval()
y_true = []
y_pred = []
for i, batch inenumerate(test_dataloader):
print(f"processing batch {i}")
batch = {k: v.to(device) for k, v in batch.items() if k != "objid"}
with torch.no_grad():
outputs = model(**batch)
y_true.extend(batch['labels'].cpu().numpy())
y_pred.extend(torch.argmax(outputs.logits, dim=2).squeeze().cpu().numpy())
print(f"accuracy: {sum([1for i, j inzip(y_true, y_pred) if i == j]) / len(y_true)}")
Runs of BrachioLab supernova-classification on huggingface.co
1.1K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About supernova-classification huggingface.co Model
supernova-classification huggingface.co is an AI model on huggingface.co that provides supernova-classification's model effect (), which can be used instantly with this BrachioLab supernova-classification model. huggingface.co supports a free trial of the supernova-classification model, and also provides paid use of the supernova-classification. Support call supernova-classification model through api, including Node.js, Python, http.
supernova-classification huggingface.co is an online trial and call api platform, which integrates supernova-classification's modeling effects, including api services, and provides a free online trial of supernova-classification, you can try supernova-classification online for free by clicking the link below.
BrachioLab supernova-classification online free url in huggingface.co:
supernova-classification is an open source model from GitHub that offers a free installation service, and any user can find supernova-classification on GitHub to install. At the same time, huggingface.co provides the effect of supernova-classification install, users can directly use supernova-classification installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
supernova-classification install url in huggingface.co: