acecalisto3 commited on
Commit
d694c92
·
verified ·
1 Parent(s): 8044f1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
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
- cited_resources = [res for res in resources if res in response]
47
- if cited_resources:
48
- return response
49
- else:
50
- return (
51
- "I'm sorry, I couldn't find specific details in the provided resources. "
52
- "Please check these resources for the latest information: "
53
- + ", ".join(resources)
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
  )