Spaces:
Sleeping
Sleeping
samyak152002
commited on
Commit
•
2e0abc7
1
Parent(s):
33e9334
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load the model from Hugging Face
|
5 |
+
classifier = pipeline("text-classification", model="samyak152002/my-disease-classifier-sih")
|
6 |
+
|
7 |
+
# Define the prediction function
|
8 |
+
def predict(text):
|
9 |
+
result = classifier(text)
|
10 |
+
return result
|
11 |
+
|
12 |
+
# Set up the Gradio interface
|
13 |
+
interface = gr.Interface(fn=predict, inputs="text", outputs="json", title="Disease Classifier")
|
14 |
+
|
15 |
+
# Launch the app
|
16 |
+
interface.launch()
|