aashwinik commited on
Commit
8ef9f1b
·
verified ·
1 Parent(s): 2752e5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -1,22 +1,23 @@
1
  import streamlit as st
2
 
3
- def load_answer(question):
4
- llm=OpenAI(model_name="text-davinci-003", temperature=0)
5
- answer=llm(question)
6
- return answer
7
-
8
- def get_text(): #from the UI App
9
- input_text = st.text_input("Enter a question: ", key="input")
10
  return input_text
 
 
 
 
 
 
11
 
12
  #UIApp starts here
13
- st.set_page_config(page_title="LangChain Demo - Simple Question Answering App", page_icon=":robot:")
14
- st.header("Simple Question Answering App")
15
 
16
- user_input=get_text()
17
- response=load_answer(user_input)
18
 
19
- submit=st.button('Generate')
20
  if submit:
21
- st.subheader("Answer: ")
22
  st.write(response)
 
1
  import streamlit as st
2
 
3
+ def get_userInput(): #from the UI App
4
+ input_text = st.text_input("Enter a number: ", key="input")
 
 
 
 
 
5
  return input_text
6
+
7
+ def validate_userInput(user_input):
8
+ if user_input.isdigit():
9
+ return True
10
+ else:
11
+ return False
12
 
13
  #UIApp starts here
14
+ st.set_page_config(page_title="Python - Tic Tac Toe", page_icon=":python:")
15
+ st.header("Python - Tic Tac Toe")
16
 
17
+ user_input=get_userInput()
18
+ response=validate_userInput(user_input)
19
 
20
+ submit=st.button('Submit')
21
  if submit:
22
+ st.subheader("")
23
  st.write(response)