Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,15 @@ st.write("Waiting for image upload and prompt input...")
|
|
| 18 |
uploaded_file = st.file_uploader("Upload an image (JPG or PNG):", type=["jpg", "jpeg", "png"])
|
| 19 |
prompt = st.text_input("Enter your prompt:", "A little girl is riding a bicycle at high speed. Focused, detailed, realistic.")
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
if uploaded_file and prompt:
|
| 22 |
try:
|
| 23 |
# Debug: File and prompt received
|
|
|
|
| 18 |
uploaded_file = st.file_uploader("Upload an image (JPG or PNG):", type=["jpg", "jpeg", "png"])
|
| 19 |
prompt = st.text_input("Enter your prompt:", "A little girl is riding a bicycle at high speed. Focused, detailed, realistic.")
|
| 20 |
|
| 21 |
+
# Cache migration step (add this before model initialization)
|
| 22 |
+
st.write("Migrating the cache for model files...")
|
| 23 |
+
try:
|
| 24 |
+
from transformers.utils import move_cache
|
| 25 |
+
move_cache()
|
| 26 |
+
st.write("Cache migration completed successfully.")
|
| 27 |
+
except Exception as e:
|
| 28 |
+
st.error(f"Cache migration failed: {e}")
|
| 29 |
+
|
| 30 |
if uploaded_file and prompt:
|
| 31 |
try:
|
| 32 |
# Debug: File and prompt received
|