Sample / model.py
Swathi6's picture
Create model.py
8cdd587 verified
raw
history blame contribute delete
306 Bytes
from transformers import pipeline
# Load the Hugging Face model pipeline (example: text classification)
def load_model():
model = pipeline("text-classification")
return model
def predict(model, text):
# Get the prediction for the input text
prediction = model(text)
return prediction