Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,7 +95,7 @@ def classify_page(statement):
|
|
95 |
Input: {statement}
|
96 |
"""
|
97 |
response = chat_session.send_message(prompt)
|
98 |
-
print(response.text.replace("```python\n", "").replace("```", "").strip())
|
99 |
return ast.literal_eval(response.text.replace("```python\n", "").replace("```", "").strip())
|
100 |
|
101 |
def create_notebook(file, tc, bc):
|
@@ -117,8 +117,6 @@ def create_notebook(file, tc, bc):
|
|
117 |
blocks = classify_page(text)
|
118 |
# print(blocks)
|
119 |
for c, value in blocks:
|
120 |
-
print(c)
|
121 |
-
print(value)
|
122 |
if c == "Code":
|
123 |
notebook.cells.append(new_code_cell(value))
|
124 |
elif c == "Text":
|
@@ -139,7 +137,8 @@ def create_notebook(file, tc, bc):
|
|
139 |
|
140 |
|
141 |
with gr.Blocks() as app:
|
142 |
-
gr.Markdown("
|
|
|
143 |
|
144 |
file_input = gr.File(label="Upload a PDF file")
|
145 |
tc = gr.Slider(label='Top Crop in Pixels', value=25)
|
|
|
95 |
Input: {statement}
|
96 |
"""
|
97 |
response = chat_session.send_message(prompt)
|
98 |
+
# print(response.text.replace("```python\n", "").replace("```", "").strip())
|
99 |
return ast.literal_eval(response.text.replace("```python\n", "").replace("```", "").strip())
|
100 |
|
101 |
def create_notebook(file, tc, bc):
|
|
|
117 |
blocks = classify_page(text)
|
118 |
# print(blocks)
|
119 |
for c, value in blocks:
|
|
|
|
|
120 |
if c == "Code":
|
121 |
notebook.cells.append(new_code_cell(value))
|
122 |
elif c == "Text":
|
|
|
137 |
|
138 |
|
139 |
with gr.Blocks() as app:
|
140 |
+
gr.Markdown("""# PDF to IPython Notebook Convertor App
|
141 |
+
##Upload your PDF document containing Python code and text and press Process File button to download the iPython Notebook")
|
142 |
|
143 |
file_input = gr.File(label="Upload a PDF file")
|
144 |
tc = gr.Slider(label='Top Crop in Pixels', value=25)
|