Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ from langchain.prompts import PromptTemplate
|
|
12 |
from langchain.chains import LLMChain
|
13 |
from langchain.chains import SequentialChain
|
14 |
import pdfkit
|
|
|
15 |
|
16 |
with open('Response.json', 'r') as file:
|
17 |
RESPONSE_JSON = json.load(file)
|
@@ -82,12 +83,10 @@ def download(df):
|
|
82 |
help="Click to download as CSV"
|
83 |
)
|
84 |
|
|
|
|
|
|
|
85 |
|
86 |
-
col2.button(label="Download PDF",
|
87 |
-
on_click=pdfkit.from_string(html_content,'generated_mcqs.pdf'),
|
88 |
-
key="pdf-download",
|
89 |
-
help="Click to download as PDF"
|
90 |
-
)
|
91 |
|
92 |
# Now you can use df outside the form if needed
|
93 |
if df is not None:
|
|
|
12 |
from langchain.chains import LLMChain
|
13 |
from langchain.chains import SequentialChain
|
14 |
import pdfkit
|
15 |
+
import wkhtmltopdf
|
16 |
|
17 |
with open('Response.json', 'r') as file:
|
18 |
RESPONSE_JSON = json.load(file)
|
|
|
83 |
help="Click to download as CSV"
|
84 |
)
|
85 |
|
86 |
+
config = pdfkit.configuration(wkhtmltopdf='wkhtmltopdf')
|
87 |
+
col2.button(label="Download PDF", on_click=lambda: pdfkit.from_string(html_content, 'generated_mcqs.pdf', configuration=config), key="pdf-download")
|
88 |
+
|
89 |
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
# Now you can use df outside the form if needed
|
92 |
if df is not None:
|