Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ import numpy as np
|
|
| 8 |
from PIL import Image, ImageEnhance
|
| 9 |
from io import BytesIO
|
| 10 |
import streamlit_ext as ste #for download button not to rerun
|
| 11 |
-
import
|
| 12 |
|
| 13 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 14 |
|
|
@@ -40,7 +40,7 @@ if uploaded_file is not None:
|
|
| 40 |
col1, col2 = st.columns( [0.5, 0.5])
|
| 41 |
with col1:
|
| 42 |
st.markdown('<p style="text-align: center;">Before</p>',unsafe_allow_html=True)
|
| 43 |
-
st.image(image,width=
|
| 44 |
|
| 45 |
with col2:
|
| 46 |
st.markdown('<p style="text-align: center;">After</p>',unsafe_allow_html=True)
|
|
@@ -76,7 +76,7 @@ if uploaded_file is not None:
|
|
| 76 |
if len(os.listdir('generated_samples')) <= 10:
|
| 77 |
img_file_name = f"generated_samples/{str(len(os.listdir('generated_samples')))}.png"
|
| 78 |
|
| 79 |
-
_ =
|
| 80 |
path_in_repo ="remote/" + img_file_name,
|
| 81 |
repo_id='AfrodreamsAI/afrodreams',
|
| 82 |
repo_type='space',
|
|
|
|
| 8 |
from PIL import Image, ImageEnhance
|
| 9 |
from io import BytesIO
|
| 10 |
import streamlit_ext as ste #for download button not to rerun
|
| 11 |
+
from huggingface_hub import upload_file as
|
| 12 |
|
| 13 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 14 |
|
|
|
|
| 40 |
col1, col2 = st.columns( [0.5, 0.5])
|
| 41 |
with col1:
|
| 42 |
st.markdown('<p style="text-align: center;">Before</p>',unsafe_allow_html=True)
|
| 43 |
+
st.image(image,width=500)
|
| 44 |
|
| 45 |
with col2:
|
| 46 |
st.markdown('<p style="text-align: center;">After</p>',unsafe_allow_html=True)
|
|
|
|
| 76 |
if len(os.listdir('generated_samples')) <= 10:
|
| 77 |
img_file_name = f"generated_samples/{str(len(os.listdir('generated_samples')))}.png"
|
| 78 |
|
| 79 |
+
_ = upload_file(path_or_fileobj = 'out.png',
|
| 80 |
path_in_repo ="remote/" + img_file_name,
|
| 81 |
repo_id='AfrodreamsAI/afrodreams',
|
| 82 |
repo_type='space',
|