Spaces:
Build error
Build error
welcome message not pushed on bot
#14
by
RCaz
- opened
app.py
CHANGED
|
@@ -139,12 +139,6 @@ def predict(message, history, request: gr.Request):
|
|
| 139 |
return "This app can only answer question about Rémi Cazelles's projects, work and education."
|
| 140 |
print("passed the safeguard")
|
| 141 |
|
| 142 |
-
WELCOME_TEXT = "This bot allows you finding informations related to Rémi Cazelles's projects, work and education"
|
| 143 |
-
if not history:
|
| 144 |
-
# Gradio expects a list of dicts with keys "role" and "content"
|
| 145 |
-
history = [
|
| 146 |
-
{"role": "assistant", "content": WELCOME_TEXT}
|
| 147 |
-
]
|
| 148 |
|
| 149 |
# Build conversation history
|
| 150 |
history_langchain_format = []
|
|
@@ -227,6 +221,7 @@ os.environ["LANGSMITH_API_KEY"] = os.environ['LANGSMITH_API_KEY']
|
|
| 227 |
import gradio as gr
|
| 228 |
iface = gr.ChatInterface(
|
| 229 |
predict,
|
|
|
|
| 230 |
api_name="chat",
|
| 231 |
)
|
| 232 |
print("Launch ...")
|
|
|
|
| 139 |
return "This app can only answer question about Rémi Cazelles's projects, work and education."
|
| 140 |
print("passed the safeguard")
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
# Build conversation history
|
| 144 |
history_langchain_format = []
|
|
|
|
| 221 |
import gradio as gr
|
| 222 |
iface = gr.ChatInterface(
|
| 223 |
predict,
|
| 224 |
+
chatbot=gr.Chatbot(value=[[None, "This bot allows you finding informations related to Rémi Cazelles's projects, work and education"]]),
|
| 225 |
api_name="chat",
|
| 226 |
)
|
| 227 |
print("Launch ...")
|