File size: 306 Bytes
8cdd587
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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