KrishP-12 commited on
Commit
6dccd9f
·
verified ·
1 Parent(s): 1dc60ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -1,21 +1,21 @@
1
  import gradio as gr
2
- from model2 import ChatbotModel
3
 
4
- # Load the model
5
- #model = torch.load("model.pt") # Adjust as needed
6
 
7
- # Define the chatbot function
8
- def chatbot(input_text):
9
- # Use your model inference function here
10
- response = ChatbotModel.get_response(input_text) # Call to your response function
11
- return response
12
 
13
  # Define the Gradio interface
14
  iface = gr.Interface(
15
- fn=chatbot, # The function that will be called
16
- inputs="text", # User will input text
17
- outputs="text" # Model will output text
 
 
18
  )
19
 
20
- # Launch the app
21
- iface.launch()
 
 
1
  import gradio as gr
2
+ from chatbot_model import ChatbotModel # Assuming your model code is saved as chatbot_model.py
3
 
4
+ # Load the chatbot model (replace "model.pt" with your actual saved model path if needed)
5
+ chatbot = ChatbotModel.load("model.pt")
6
 
7
+ def generate_response(user_input):
8
+ return chatbot.get_response(user_input)
 
 
 
9
 
10
  # Define the Gradio interface
11
  iface = gr.Interface(
12
+ fn=generate_response,
13
+ inputs="text",
14
+ outputs="text",
15
+ title="ACPC Counseling Chatbot",
16
+ description="Chatbot assistant for queries related to ACPC counseling, MYSY scholarships, and admissions."
17
  )
18
 
19
+ if __name__ == "__main__":
20
+ # Launch the Gradio interface
21
+ iface.launch()