nornorr commited on
Commit
842f92d
·
1 Parent(s): 152a7c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,16 +1,16 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- classifier = pipeline("conversational", model="gpt2-uk-conversational")
5
  def main():
6
- st.title("Text-classification")
7
 
8
  with st.form("text_field"):
9
- text = st.text_area('enter some text:')
10
  # clicked==True only when the button is clicked
11
  clicked = st.form_submit_button("Submit")
12
  if clicked:
13
- results = classifier([text])
14
  st.json(results)
15
 
16
  if __name__ == "__main__":
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ classifier = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
5
  def main():
6
+ st.title("image-to-text")
7
 
8
  with st.form("text_field"):
9
+ image = st.file_uploader('Choose a file')
10
  # clicked==True only when the button is clicked
11
  clicked = st.form_submit_button("Submit")
12
  if clicked:
13
+ results = classifier([image])
14
  st.json(results)
15
 
16
  if __name__ == "__main__":