update main
Browse files
app.py
CHANGED
|
@@ -99,7 +99,7 @@ def bot(user_message, history):
|
|
| 99 |
bot_message = data[0]
|
| 100 |
sources = ', '.join(data[1])
|
| 101 |
# Update the chat history with the bot's response and sources
|
| 102 |
-
history.append([user_message, f"{bot_message}
|
| 103 |
else:
|
| 104 |
raise ValueError # Not a tuple with sources, treat it as a plain text message
|
| 105 |
except (SyntaxError, ValueError):
|
|
@@ -112,7 +112,7 @@ def bot(user_message, history):
|
|
| 112 |
|
| 113 |
#gr.Chatbot.postprocess = postprocess
|
| 114 |
|
| 115 |
-
with open("assets/custom.css", "r", encoding="utf-8") as f:
|
| 116 |
customCSS = f.read()
|
| 117 |
|
| 118 |
with gr.Blocks(css=customCSS, theme=wordlift_theme) as demo:
|
|
@@ -128,7 +128,7 @@ with gr.Blocks(css=customCSS, theme=wordlift_theme) as demo:
|
|
| 128 |
#demo = gr.Interface(fn=bot, inputs=msg, outputs=chatbot, theme="dark", title="WL-Chat", description="A chatbot to interact with WordLift's blog.")
|
| 129 |
|
| 130 |
demo.queue()
|
| 131 |
-
demo.launch(inline=True)
|
| 132 |
|
| 133 |
if __name__ == "__main__":
|
| 134 |
main()
|
|
|
|
| 99 |
bot_message = data[0]
|
| 100 |
sources = ', '.join(data[1])
|
| 101 |
# Update the chat history with the bot's response and sources
|
| 102 |
+
history.append([user_message, f"{bot_message}\n\nLearn more: {sources}"])
|
| 103 |
else:
|
| 104 |
raise ValueError # Not a tuple with sources, treat it as a plain text message
|
| 105 |
except (SyntaxError, ValueError):
|
|
|
|
| 112 |
|
| 113 |
#gr.Chatbot.postprocess = postprocess
|
| 114 |
|
| 115 |
+
with open("/Users/cyberandy/Documents/GitHub/langchain-wl-chat/wl-chat/assets/custom.css", "r", encoding="utf-8") as f:
|
| 116 |
customCSS = f.read()
|
| 117 |
|
| 118 |
with gr.Blocks(css=customCSS, theme=wordlift_theme) as demo:
|
|
|
|
| 128 |
#demo = gr.Interface(fn=bot, inputs=msg, outputs=chatbot, theme="dark", title="WL-Chat", description="A chatbot to interact with WordLift's blog.")
|
| 129 |
|
| 130 |
demo.queue()
|
| 131 |
+
demo.launch(share=True, inline=True)
|
| 132 |
|
| 133 |
if __name__ == "__main__":
|
| 134 |
main()
|