Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from fastai.text.all import *
|
2 |
-
from transformers import BlenderbotForConditionalGeneration, BlenderbotTokenizer
|
3 |
import torch
|
4 |
import gradio as gr
|
5 |
|
@@ -15,7 +15,7 @@ def classify_medical_text(txt):
|
|
15 |
return dict(zip(medical_categories, map(float, probs)))
|
16 |
|
17 |
# Load the psychiatric model from Hugging Face
|
18 |
-
psychiatric_model_name = "
|
19 |
psychiatric_tokenizer = AutoTokenizer.from_pretrained(psychiatric_model_name)
|
20 |
psychiatric_model = AutoModelForSequenceClassification.from_pretrained(psychiatric_model_name)
|
21 |
|
@@ -96,8 +96,4 @@ with gr.Blocks() as lifestyle_interface:
|
|
96 |
|
97 |
# Combine interfaces using Tabs
|
98 |
app = gr.TabbedInterface(
|
99 |
-
[
|
100 |
-
["Medical Diagnosis", "Psychiatric Analysis", "Lifestyle & Nutrition Chat"]
|
101 |
-
)
|
102 |
-
|
103 |
-
app.launch(inline=False)
|
|
|
1 |
from fastai.text.all import *
|
2 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, BlenderbotForConditionalGeneration, BlenderbotTokenizer
|
3 |
import torch
|
4 |
import gradio as gr
|
5 |
|
|
|
15 |
return dict(zip(medical_categories, map(float, probs)))
|
16 |
|
17 |
# Load the psychiatric model from Hugging Face
|
18 |
+
psychiatric_model_name = "mental/mental-bert-base-uncased" # Replace with the appropriate model
|
19 |
psychiatric_tokenizer = AutoTokenizer.from_pretrained(psychiatric_model_name)
|
20 |
psychiatric_model = AutoModelForSequenceClassification.from_pretrained(psychiatric_model_name)
|
21 |
|
|
|
96 |
|
97 |
# Combine interfaces using Tabs
|
98 |
app = gr.TabbedInterface(
|
99 |
+
[medi
|
|
|
|
|
|
|
|