Update src/streamlit_app.py
Browse files- 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="
|
| 4 |
|
| 5 |
-
st.title("
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|