Spaces:
Runtime error
Runtime error
adding UI features and examples
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ def respond(message, history):
|
|
| 56 |
if history:
|
| 57 |
messages.extend(history)
|
| 58 |
|
| 59 |
-
user_context = f"{message}\
|
| 60 |
messages.append({"role": "user", "content": user_context})
|
| 61 |
|
| 62 |
response = ""
|
|
@@ -72,5 +72,10 @@ def respond(message, history):
|
|
| 72 |
response += token
|
| 73 |
yield response
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
if history:
|
| 57 |
messages.extend(history)
|
| 58 |
|
| 59 |
+
user_context = f"{message}\nInformation: {context}"
|
| 60 |
messages.append({"role": "user", "content": user_context})
|
| 61 |
|
| 62 |
response = ""
|
|
|
|
| 72 |
response += token
|
| 73 |
yield response
|
| 74 |
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
chatbot = gr.ChatInterface(respond, type='messages', title="Ask me about Book Bans!", description="An AI assistant to keep you updated on recent book banning news!",examples=["What are the most common genres of book bans?", "Where in the US are the most book banning actions?", "How many books were banned in 2024?"])
|
| 78 |
+
chatbot.launch()
|
| 79 |
+
|
| 80 |
+
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
| 81 |
+
gr.Image("book_bans.jpg", show_label = False, show_share_button = False, show_download_button = False)
|