Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,8 @@ import streamlit as st
|
|
| 2 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 3 |
import torch
|
| 4 |
|
| 5 |
-
# Load pre-trained
|
| 6 |
-
model_name = "
|
| 7 |
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
| 8 |
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
| 9 |
|
|
@@ -12,7 +12,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
| 12 |
model.to(device)
|
| 13 |
|
| 14 |
# Streamlit Interface
|
| 15 |
-
st.title("
|
| 16 |
|
| 17 |
def generate_response(input_text):
|
| 18 |
# Add conversational context to input
|
|
|
|
| 2 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
# Load pre-trained model and tokenizer from the "KhantKyaw/T5-small_new_chatbot"
|
| 6 |
+
model_name = "KhantKyaw/T5-small_new_chatbot" # Use the fine-tuned model
|
| 7 |
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
| 8 |
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
| 9 |
|
|
|
|
| 12 |
model.to(device)
|
| 13 |
|
| 14 |
# Streamlit Interface
|
| 15 |
+
st.title("Mental Health Chatbot with T5")
|
| 16 |
|
| 17 |
def generate_response(input_text):
|
| 18 |
# Add conversational context to input
|