Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
model_id = "thrishala/mental_health_chatbot"
|
| 5 |
|
| 6 |
model_id = "thrishala/mental_health_chatbot"
|
| 7 |
|
|
@@ -49,6 +48,7 @@ def respond(
|
|
| 49 |
print(f"Error during generation: {e}")
|
| 50 |
yield "An error occurred during generation." #Handle generation errors.
|
| 51 |
|
|
|
|
| 52 |
# 4. Gradio Interface (No changes needed here)
|
| 53 |
demo = gr.ChatInterface(
|
| 54 |
respond,
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
| 3 |
+
import torch
|
|
|
|
| 4 |
|
| 5 |
model_id = "thrishala/mental_health_chatbot"
|
| 6 |
|
|
|
|
| 48 |
print(f"Error during generation: {e}")
|
| 49 |
yield "An error occurred during generation." #Handle generation errors.
|
| 50 |
|
| 51 |
+
|
| 52 |
# 4. Gradio Interface (No changes needed here)
|
| 53 |
demo = gr.ChatInterface(
|
| 54 |
respond,
|