Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import openai
|
3 |
import urllib.parse
|
4 |
-
import cairosvg
|
5 |
import io
|
6 |
|
7 |
# Function to call OpenAI GPT model for prompt processing
|
@@ -81,26 +80,5 @@ def main():
|
|
81 |
else:
|
82 |
st.error("Please enter a prompt.")
|
83 |
|
84 |
-
# Add SVG file upload and conversion section
|
85 |
-
st.subheader("SVG to PNG Converter")
|
86 |
-
svg_file = st.file_uploader("Upload an SVG file to convert to PNG", type="svg")
|
87 |
-
|
88 |
-
if svg_file:
|
89 |
-
st.write("SVG file uploaded successfully!")
|
90 |
-
png_file = convert_svg_to_png(svg_file)
|
91 |
-
|
92 |
-
if png_file:
|
93 |
-
st.image(png_file, caption="Converted PNG Image", use_column_width=True)
|
94 |
-
|
95 |
-
# Provide a download link for the PNG file
|
96 |
-
st.download_button(
|
97 |
-
label="Download PNG",
|
98 |
-
data=png_file,
|
99 |
-
file_name="converted_image.png",
|
100 |
-
mime="image/png"
|
101 |
-
)
|
102 |
-
else:
|
103 |
-
st.error("Error in converting the SVG file to PNG.")
|
104 |
-
|
105 |
if __name__ == "__main__":
|
106 |
main()
|
|
|
1 |
import streamlit as st
|
2 |
import openai
|
3 |
import urllib.parse
|
|
|
4 |
import io
|
5 |
|
6 |
# Function to call OpenAI GPT model for prompt processing
|
|
|
80 |
else:
|
81 |
st.error("Please enter a prompt.")
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
if __name__ == "__main__":
|
84 |
main()
|