Spaces:
Sleeping
Sleeping
pushpendra.parmar
commited on
Commit
·
dd4c86a
1
Parent(s):
71ed633
git ignore updated
Browse files- .gitignore +23 -0
- app.py +8 -1
.gitignore
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python cache files
|
| 2 |
+
*.pyc
|
| 3 |
+
__pycache__/
|
| 4 |
+
|
| 5 |
+
# Temporary files
|
| 6 |
+
temp_image.jpg
|
| 7 |
+
*.tmp
|
| 8 |
+
|
| 9 |
+
# Streamlit app files
|
| 10 |
+
*.streamlit
|
| 11 |
+
|
| 12 |
+
# Environment files
|
| 13 |
+
.env
|
| 14 |
+
|
| 15 |
+
# Logs
|
| 16 |
+
*.log
|
| 17 |
+
|
| 18 |
+
# OS-specific files
|
| 19 |
+
.DS_Store
|
| 20 |
+
Thumbs.db
|
| 21 |
+
|
| 22 |
+
# Generated HTML files
|
| 23 |
+
index.html
|
app.py
CHANGED
|
@@ -61,6 +61,13 @@ def main():
|
|
| 61 |
|
| 62 |
if uploaded_file is not None:
|
| 63 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# Load and display the image
|
| 65 |
image = Image.open(uploaded_file)
|
| 66 |
st.image(image, caption='Uploaded Image.', use_container_width=True)
|
|
@@ -105,7 +112,7 @@ def main():
|
|
| 105 |
st.write(f"You selected: {uiFrameWork}")
|
| 106 |
|
| 107 |
generated_html = send_message_to_model(detailed_prompt, temp_image_path)
|
| 108 |
-
|
| 109 |
|
| 110 |
# Save the refined HTML to a file
|
| 111 |
with open("index.html", "w") as file:
|
|
|
|
| 61 |
|
| 62 |
if uploaded_file is not None:
|
| 63 |
try:
|
| 64 |
+
if uploaded_file.size > 5 * 1024 * 1024: # Limit file size to 5MB
|
| 65 |
+
st.error("File size exceeds the limit of 5MB.")
|
| 66 |
+
return
|
| 67 |
+
if uploaded_file.type not in ["image/jpeg", "image/png"]:
|
| 68 |
+
st.error("Invalid file type. Please upload a JPEG or PNG image.")
|
| 69 |
+
return
|
| 70 |
+
|
| 71 |
# Load and display the image
|
| 72 |
image = Image.open(uploaded_file)
|
| 73 |
st.image(image, caption='Uploaded Image.', use_container_width=True)
|
|
|
|
| 112 |
st.write(f"You selected: {uiFrameWork}")
|
| 113 |
|
| 114 |
generated_html = send_message_to_model(detailed_prompt, temp_image_path)
|
| 115 |
+
|
| 116 |
|
| 117 |
# Save the refined HTML to a file
|
| 118 |
with open("index.html", "w") as file:
|