zakerytclarke commited on
Commit
4a56dea
·
verified ·
1 Parent(s): b962028

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -321,7 +321,6 @@ def main():
321
  with st.chat_message(message["role"]):
322
  st.markdown(message["content"])
323
 
324
- user_input = st.chat_input("Ask me anything")
325
  list1 = ["Tell me about teapotllm", "What is Teapot AI?","What devices can Teapot run on?","Who are you?"]
326
  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"]
327
  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"]
@@ -335,16 +334,23 @@ def main():
335
 
336
  s1, s2, s3 = st.columns([1, 1, 1])
337
 
 
 
338
  with s1:
339
  if st.button(choice1, use_container_width=True):
340
  user_input = choice1
341
-
342
  with s2:
343
- if st.button(choice2, use_container_width=True):
344
  user_input = choice2
 
345
  with s3:
346
  if st.button(choice3, use_container_width=True):
347
  user_input = choice3
 
 
 
 
348
 
349
  if user_input:
350
  with st.spinner('Generating Response...'):
 
321
  with st.chat_message(message["role"]):
322
  st.markdown(message["content"])
323
 
 
324
  list1 = ["Tell me about teapotllm", "What is Teapot AI?","What devices can Teapot run on?","Who are you?"]
325
  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"]
326
  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"]
 
334
 
335
  s1, s2, s3 = st.columns([1, 1, 1])
336
 
337
+ user_input = None
338
+
339
  with s1:
340
  if st.button(choice1, use_container_width=True):
341
  user_input = choice1
342
+
343
  with s2:
344
+ if st.button(choice2, use_container_width=True):
345
  user_input = choice2
346
+
347
  with s3:
348
  if st.button(choice3, use_container_width=True):
349
  user_input = choice3
350
+
351
+ # Also allow user input through text box
352
+ if not user_input:
353
+ user_input = st.chat_input("Ask me anything")
354
 
355
  if user_input:
356
  with st.spinner('Generating Response...'):