Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
-
from
|
3 |
|
4 |
-
# Load the model
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
|
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=
|
16 |
-
inputs="text",
|
17 |
-
outputs="text"
|
|
|
|
|
18 |
)
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
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()
|