Downloads · 30 days
3
23% of all-time downloads
Nilayan87/ocean_hazard_onnx
ocean_hazard_onnx is a machine learning model from Nilayan87. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a quantized ONNX version of the Ocean Hazard Detection model, optimized for faster inference and lower memory usage.
Downloads · 30 days
3
23% of all-time downloads
All-time downloads
13
Public
Repo size
218 MB
Likes
0
Public
Click a slice to open those files.
.onnx197 MB · 90%
From the Hugging Face model README
This repository contains a quantized ONNX version of the Ocean Hazard Detection model, optimized for faster inference and lower memory usage.
The model can classify social media posts into:
model_quantized.onnx : Quantized ONNX modelconfig.json : Model configurationtokenizer.json, spiece.model : Tokenizer filesspecial_tokens_map.json, tokenizer_config.json : Tokenizer configsort_config.json : ONNX Runtime configurationfrom optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
import torch
# Load model + tokenizer
model = ORTModelForSequenceClassification.from_pretrained("Nilayan87/ocean_hazard_onnx")
tokenizer = AutoTokenizer.from_pretrained("Nilayan87/ocean_hazard_onnx")
# Example input
text = "Cyclone alert near Vizag coast ⚠️ stay safe!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
# Prediction
pred = torch.argmax(outputs.logits, dim=1).item()
print("Prediction:", pred)