Spaces:
Sleeping

Robsonfll commited on
Commit
e8a4726
路
verified 路
1 Parent(s): 1f3efc8

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +15 -6
src/streamlit_app.py CHANGED
@@ -1,14 +1,23 @@
1
  import streamlit as st
 
 
2
 
3
- st.set_page_config(page_title="Teste upload", page_icon="馃И", layout="centered")
4
 
5
- st.title("Teste Streamlit no Hugging Face")
 
6
 
7
- file = st.file_uploader("Envie qualquer imagem")
8
 
9
- if file:
10
- st.image(file)
11
- st.success("Upload OK!")
 
 
 
 
 
 
12
  else:
13
  st.info("Nenhum arquivo enviado ainda.")
14
 
 
1
  import streamlit as st
2
+ from PIL import Image
3
+ import io
4
 
5
+ st.set_page_config(page_title="ArqueoIA - Teste", page_icon="馃椏", layout="centered")
6
 
7
+ st.title("ArqueoIA 馃椏")
8
+ st.subheader("Teste de upload funcionando no Hugging Face")
9
 
10
+ st.write("Envie uma imagem (JPG ou PNG):")
11
 
12
+ file = st.file_uploader("Enviar imagem", type=["jpg", "jpeg", "png"])
13
+
14
+ if file is not None:
15
+ try:
16
+ img = Image.open(file)
17
+ st.image(img, caption="Imagem recebida!", use_column_width=True)
18
+ st.success("Upload funcionando sem erro 403! 馃帀")
19
+ except Exception as e:
20
+ st.error(f"Erro ao abrir a imagem: {e}")
21
  else:
22
  st.info("Nenhum arquivo enviado ainda.")
23