DrishtiSharma commited on
Commit
bf0654b
Β·
verified Β·
1 Parent(s): 1c7c6a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 io.StringIO(content)
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
+