toursingapore commited on
Commit
44c9b16
1 Parent(s): 7b9da80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -4,12 +4,15 @@ from transformers import pipeline
4
  def main():
5
  st.title("Hello Streamlit App")
6
  st.write("Welcome to the Hello Streamlit app!")
7
- name = st.text_input("Enter your name:")
8
- if st.button("Greet"):
 
9
  st.write(f"Hello, {name}! Nice to meet you!")
10
 
11
- pipe = pipeline("text-classification")
12
- pipe("This restaurant is awesome")
 
 
13
 
14
  if __name__ == "__main__":
15
  main()
 
4
  def main():
5
  st.title("Hello Streamlit App")
6
  st.write("Welcome to the Hello Streamlit app!")
7
+ name = st.text_input("Enter your name:")
8
+ button = st.button("Submit", type="primary", key="1")
9
+ if button:
10
  st.write(f"Hello, {name}! Nice to meet you!")
11
 
12
+ #Load model
13
+ pipe = pipeline("text-classification")
14
+ results = pipe(name)
15
+ st.write(results)
16
 
17
  if __name__ == "__main__":
18
  main()