REALME5-pro commited on
Commit
cbee0a3
·
verified ·
1 Parent(s): dc200c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
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 = "nlp4good/psych-search" # 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,8 +96,4 @@ with gr.Blocks() as lifestyle_interface:
96
 
97
  # Combine interfaces using Tabs
98
  app = gr.TabbedInterface(
99
- [medical_interface, psychiatric_interface, lifestyle_interface],
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