Pisethan commited on
Commit
d0afe25
·
verified ·
1 Parent(s): 7268b87

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load model
5
+ classifier = pipeline("text-classification", model="Pisethan/khmer-classifier")
6
+
7
+ def predict(text):
8
+ output = classifier(text)[0]
9
+ return f"📚 Label: {output['label']} (Score: {output['score']:.2f})"
10
+
11
+ demo = gr.Interface(fn=predict, inputs="text", outputs="text", title="Khmer Prompt Classifier")
12
+ demo.launch()