Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,15 +43,15 @@ def format_messages(messages):
|
|
43 |
|
44 |
# Filter responses to ensure they are based on RESOURCES
|
45 |
def filter_response(response, resources):
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
56 |
# Generate response using the pipeline
|
57 |
def generate_response(formatted_messages):
|
@@ -107,7 +107,6 @@ iface = gr.Interface(
|
|
107 |
description=(
|
108 |
"Ask any questions related to South Spencer County Schools, "
|
109 |
"and I will provide accurate answers based on the available resources. "
|
110 |
-
"Examples of resources include the school calendar, board meetings, and transportation information."
|
111 |
),
|
112 |
theme="default" # You can change the theme if desired
|
113 |
)
|
|
|
43 |
|
44 |
# Filter responses to ensure they are based on RESOURCES
|
45 |
def filter_response(response, resources):
|
46 |
+
for res in resources:
|
47 |
+
if res in response:
|
48 |
+
return response
|
49 |
+
return (
|
50 |
+
"I couldn't find specific details in the resources provided. "
|
51 |
+
"Please consult these for further information: "
|
52 |
+
+ ", ".join(resources)
|
53 |
+
)
|
54 |
+
|
55 |
|
56 |
# Generate response using the pipeline
|
57 |
def generate_response(formatted_messages):
|
|
|
107 |
description=(
|
108 |
"Ask any questions related to South Spencer County Schools, "
|
109 |
"and I will provide accurate answers based on the available resources. "
|
|
|
110 |
),
|
111 |
theme="default" # You can change the theme if desired
|
112 |
)
|