Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def orchestrate_workflow(client, url):
|
|
112 |
# Helper functions to create text and PDF files
|
113 |
def create_text_file(content):
|
114 |
"""Create a downloadable text file."""
|
115 |
-
return
|
116 |
|
117 |
def create_pdf_file(content):
|
118 |
"""Create a downloadable PDF file."""
|
@@ -130,7 +130,7 @@ def create_pdf_file(content):
|
|
130 |
y -= 20
|
131 |
c.save()
|
132 |
buffer.seek(0)
|
133 |
-
return buffer
|
134 |
|
135 |
# Streamlit App UI
|
136 |
st.markdown(
|
@@ -209,3 +209,4 @@ if 'OPENAI_API_KEY' in os.environ and os.environ['OPENAI_API_KEY']:
|
|
209 |
st.error("β Please enter a valid URL.")
|
210 |
else:
|
211 |
st.sidebar.warning("β οΈ OpenAI API Key not set. Please check your Hugging Face secrets configuration.")
|
|
|
|
112 |
# Helper functions to create text and PDF files
|
113 |
def create_text_file(content):
|
114 |
"""Create a downloadable text file."""
|
115 |
+
return content # Return plain text
|
116 |
|
117 |
def create_pdf_file(content):
|
118 |
"""Create a downloadable PDF file."""
|
|
|
130 |
y -= 20
|
131 |
c.save()
|
132 |
buffer.seek(0)
|
133 |
+
return buffer.getvalue() # Return binary content
|
134 |
|
135 |
# Streamlit App UI
|
136 |
st.markdown(
|
|
|
209 |
st.error("β Please enter a valid URL.")
|
210 |
else:
|
211 |
st.sidebar.warning("β οΈ OpenAI API Key not set. Please check your Hugging Face secrets configuration.")
|
212 |
+
|