ajm19826 commited on
Commit
bf53e60
·
verified ·
1 Parent(s): 3da7b20

Create predict.py

Browse files
Files changed (1) hide show
  1. predict.py +15 -0
predict.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ classifier = pipeline(
4
+ "text-classification",
5
+ model="./model",
6
+ tokenizer="./model"
7
+ )
8
+
9
+ while True:
10
+ text = input("Say something > ")
11
+ if text.lower() in ["exit", "quit"]:
12
+ break
13
+
14
+ result = classifier(text)[0]
15
+ print(f"✨ Vibe: {result['label']} ({result['score']:.2f})\n")