Spaces:
Sleeping
Sleeping
Commit
•
f0cfcef
1
Parent(s):
b2c6adc
Update app.py
Browse files
app.py
CHANGED
@@ -107,6 +107,8 @@ def predict(message, history):
|
|
107 |
assess_rag = classification_chatrag(message)
|
108 |
if assess_rag:
|
109 |
source_text = vector_search(message)
|
|
|
|
|
110 |
|
111 |
history_transformer_format = history + [[message, ""]]
|
112 |
|
@@ -168,5 +170,11 @@ examples = [
|
|
168 |
]
|
169 |
]
|
170 |
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
-
|
|
|
|
107 |
assess_rag = classification_chatrag(message)
|
108 |
if assess_rag:
|
109 |
source_text = vector_search(message)
|
110 |
+
else:
|
111 |
+
source_text = "Albert-Tchap n'utilise pas de sources comme votre requête n'a pas l'air d'en recueillir."
|
112 |
|
113 |
history_transformer_format = history + [[message, ""]]
|
114 |
|
|
|
170 |
]
|
171 |
]
|
172 |
|
173 |
+
demo = gr.Blocks()
|
174 |
+
|
175 |
+
with gr.Blocks as demo:
|
176 |
+
gr.ChatInterface(predict)
|
177 |
+
gr.HTML("""<h3 style="text-align:center">Sources</h3><p>""" + source_text + """</p>""")
|
178 |
|
179 |
+
if __name__ == "__main__":
|
180 |
+
demo.queue().launch()
|