hertogateis commited on
Commit
6422bb0
·
verified ·
1 Parent(s): 3b94a44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 T5 model and tokenizer
6
- model_name = "t5-small" # Use t5-small for faster responses
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("Simple Chatbot with T5")
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