Update app.py
Browse files
app.py
CHANGED
@@ -118,10 +118,10 @@ def query_model(question):
|
|
118 |
"""
|
119 |
if question == "":
|
120 |
return "Welcome to AI-nstein! Ask me anything about AI ML, and helpful tools you may want to use!"
|
121 |
-
|
122 |
if not relevant_segment:
|
123 |
return "Could not find specific information. Please refine your question."
|
124 |
-
|
125 |
return response
|
126 |
|
127 |
# Define the welcome message and specific topics the chatbot can provide information about
|
@@ -159,7 +159,7 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
|
159 |
response, confidence_score = query_model(question)
|
160 |
answer.value = f"Response: {response}\nConfidence Score: {confidence_score:.2f}"
|
161 |
|
162 |
-
submit_button.click(fn=display_response, inputs=question, outputs=None)
|
163 |
|
164 |
|
165 |
|
|
|
118 |
"""
|
119 |
if question == "":
|
120 |
return "Welcome to AI-nstein! Ask me anything about AI ML, and helpful tools you may want to use!"
|
121 |
+
relevant_segment = find_relevant_segment(question, segments)
|
122 |
if not relevant_segment:
|
123 |
return "Could not find specific information. Please refine your question."
|
124 |
+
response = generate_response(question, relevant_segment)
|
125 |
return response
|
126 |
|
127 |
# Define the welcome message and specific topics the chatbot can provide information about
|
|
|
159 |
response, confidence_score = query_model(question)
|
160 |
answer.value = f"Response: {response}\nConfidence Score: {confidence_score:.2f}"
|
161 |
|
162 |
+
#submit_button.click(fn=display_response, inputs=question, outputs=None)
|
163 |
|
164 |
|
165 |
|