Swathi6 commited on
Commit
8cdd587
·
verified ·
1 Parent(s): 2ac5345

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +11 -0
model.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ # Load the Hugging Face model pipeline (example: text classification)
4
+ def load_model():
5
+ model = pipeline("text-classification")
6
+ return model
7
+
8
+ def predict(model, text):
9
+ # Get the prediction for the input text
10
+ prediction = model(text)
11
+ return prediction