coldnasser commited on
Commit
ce47d0c
·
1 Parent(s): 6e77bf4

Upload Gradio app for mental health analysis

Browse files
Files changed (2) hide show
  1. app.py +17 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load your model from Hugging Face
5
+ classifier = pipeline("text-classification", model="coldnasser/depression-anxiety-mindscape")
6
+
7
+ # Define the prediction function
8
+ def predict(text):
9
+ return classifier(text)
10
+
11
+ # Create the Gradio interface
12
+ gr.Interface(
13
+ fn=predict,
14
+ inputs="text",
15
+ outputs="label",
16
+ title="Mindscape AI Therapist"
17
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ transformers
2
+ gradio