bizvideoschool commited on
Commit
4668199
1 Parent(s): 94ea6d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import streamlit as st
2
  import openai
3
- import pdfkit
4
 
5
  # Access the OpenAI API key from Hugging Face Spaces secrets
6
  openai.api_key = st.secrets["OPENAI_API_KEY"]
@@ -51,15 +50,10 @@ if st.button('Generate My Video Marketing Plan'):
51
  st.markdown("### Your Customized Video Marketing Plan")
52
  st.write(marketing_plan)
53
 
54
- # Convert the marketing plan to a PDF and provide a download button
55
  if marketing_plan:
56
- formatted_plan = marketing_plan.replace('\n', '<br>')
57
- html = f"<html><body><h2>Your Customized Video Marketing Plan</h2><p>{formatted_plan}</p></body></html>"
58
- pdf = pdfkit.from_string(html, False)
59
-
60
- st.download_button(
61
- label="Download your plan as PDF",
62
- data=pdf,
63
- file_name="video_marketing_plan.pdf",
64
- mime="application/octet-stream"
65
- )
 
1
  import streamlit as st
2
  import openai
 
3
 
4
  # Access the OpenAI API key from Hugging Face Spaces secrets
5
  openai.api_key = st.secrets["OPENAI_API_KEY"]
 
50
  st.markdown("### Your Customized Video Marketing Plan")
51
  st.write(marketing_plan)
52
 
53
+ # Copy to clipboard button
54
  if marketing_plan:
55
+ st.markdown("## Copy Marketing Plan")
56
+ st.text_area("Copy and paste the plan:", marketing_plan, height=300, key="text_area")
57
+ st.button("Copy to Clipboard", key="copy-button")
58
+
59
+ # No additional code needed beyond this point for your application