zakerytclarke commited on
Commit
f1ebe90
·
verified ·
1 Parent(s): 08dec69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -294,7 +294,7 @@ def handle_chat(user_prompt, user_input, teapot_ai):
294
  st.sidebar.write("---")
295
 
296
  context = "\n".join(documents)
297
- prompt = """You are Teapot, an open-source AI assistant optimized for low-end devices, providing short, accurate responses without hallucinating while excelling at information extraction and text summarization.If a user asks who you are reply "I am Teapot"."""
298
  response = query_teapot(prompt, context+user_prompt, user_input, teapot_ai)
299
 
300
  with st.chat_message("assistant"):
@@ -325,20 +325,23 @@ def main():
325
  st.markdown(message["content"])
326
 
327
  user_input = st.chat_input("Ask me anything")
328
- list1 = ["Tell me about teapotllm", "What is Teapot AI?", "How does teapotllm work?"]
329
  list2 = ["Who invented quantum mechanics?", "Who are the authors of attention is all you need", "Tell me about popular places to travel in France","Tell me about Isaac Asimov", "Explain artificial intelligence"]
330
  list3 = ["Extract the year Google was founded", "Extract the last name of the father of artificial intelligence", "Output the capital of New York","Extarct the city where the louvre is located","Find the chemical symbol for gold"]
331
 
332
  # Randomly select one from each list
333
  random_selection = [random.choice(list1), random.choice(list2), random.choice(list3)]
334
 
 
 
 
335
  s1, s2, s3 = st.columns([1, 2, 3])
336
  with s1:
337
- user_input = suggestion_button(random.choice(list1)) or user_input
338
  with s2:
339
- user_input = suggestion_button(random.choice(list2)) or user_input
340
  with s3:
341
- user_input = suggestion_button(random.choice(list3)) or user_input
342
 
343
  if user_input:
344
  with st.spinner('Generating Response...'):
 
294
  st.sidebar.write("---")
295
 
296
  context = "\n".join(documents)
297
+ prompt = """You are Teapot, an open-source AI assistant optimized for low-end devices, providing short, accurate responses without hallucinating while excelling at information extraction and text summarization. If a user asks who you are reply "I am Teapot"."""
298
  response = query_teapot(prompt, context+user_prompt, user_input, teapot_ai)
299
 
300
  with st.chat_message("assistant"):
 
325
  st.markdown(message["content"])
326
 
327
  user_input = st.chat_input("Ask me anything")
328
+ list1 = ["Tell me about teapotllm", "What is Teapot AI?","What devices can Teapot run on?","Who are you?"]
329
  list2 = ["Who invented quantum mechanics?", "Who are the authors of attention is all you need", "Tell me about popular places to travel in France","Tell me about Isaac Asimov", "Explain artificial intelligence"]
330
  list3 = ["Extract the year Google was founded", "Extract the last name of the father of artificial intelligence", "Output the capital of New York","Extarct the city where the louvre is located","Find the chemical symbol for gold"]
331
 
332
  # Randomly select one from each list
333
  random_selection = [random.choice(list1), random.choice(list2), random.choice(list3)]
334
 
335
+ choice1 = random.choice(list1)
336
+ choice2 = random.choice(list2)
337
+ choice3 = random.choice(list3)
338
  s1, s2, s3 = st.columns([1, 2, 3])
339
  with s1:
340
+ user_input = suggestion_button(choice1) or user_input
341
  with s2:
342
+ user_input = suggestion_button(choice2) or user_input
343
  with s3:
344
+ user_input = suggestion_button(choice3) or user_input
345
 
346
  if user_input:
347
  with st.spinner('Generating Response...'):