Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipe = pipeline('sentiment-analysis')
|
@@ -6,4 +6,28 @@ text = st.text_area('Enter some text: ')
|
|
6 |
|
7 |
if text:
|
8 |
out = pipe(text)
|
9 |
-
st.json(out)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
'''import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipe = pipeline('sentiment-analysis')
|
|
|
6 |
|
7 |
if text:
|
8 |
out = pipe(text)
|
9 |
+
st.json(out)'''
|
10 |
+
|
11 |
+
import streamlit as st
|
12 |
+
from PIL import Image
|
13 |
+
|
14 |
+
def load_image(image_file):
|
15 |
+
img = Image.open(image_file)
|
16 |
+
return img
|
17 |
+
|
18 |
+
def main():
|
19 |
+
st.title("File Upload Tutorial")
|
20 |
+
|
21 |
+
menu = ["Image"]
|
22 |
+
choice = st.sidebar.selectbox("Menu",menu)
|
23 |
+
|
24 |
+
if choice == "Image":
|
25 |
+
st.subheader("Image")
|
26 |
+
image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"])
|
27 |
+
|
28 |
+
if image_file is not None:
|
29 |
+
file_details = {"filename":image_file.name,
|
30 |
+
"filetype":image_file.type,
|
31 |
+
"filesize":image_file.size}
|
32 |
+
st.write(file_details)
|
33 |
+
st.image(load_image(image_file),width=250)
|