anikapro commited on
Commit
bcbbf70
·
verified ·
1 Parent(s): 6e459ff

adding UI features and examples

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -56,7 +56,7 @@ def respond(message, history):
56
  if history:
57
  messages.extend(history)
58
 
59
- user_context = f"{message}\nContext to consider: {context}"
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
- chatbot = gr.ChatInterface(respond, type='messages', title="Ask me about Book Bans!")
76
- chatbot.launch()
 
 
 
 
 
 
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)