Spaces:
Running
Running
Update app
Browse files
app.py
CHANGED
|
@@ -205,7 +205,6 @@ def set_up_chat_ui():
|
|
| 205 |
},
|
| 206 |
'options': {
|
| 207 |
'wait_for_model': True,
|
| 208 |
-
|
| 209 |
'use_cache': True
|
| 210 |
}
|
| 211 |
})
|
|
@@ -277,7 +276,6 @@ def generate_slide_deck(json_str: str):
|
|
| 277 |
slides_template=pptx_template,
|
| 278 |
output_file_path=path
|
| 279 |
)
|
| 280 |
-
_display_download_button(path)
|
| 281 |
except ValueError:
|
| 282 |
# st.error(
|
| 283 |
# f"{APP_TEXT['json_parsing_error']}"
|
|
@@ -290,10 +288,10 @@ def generate_slide_deck(json_str: str):
|
|
| 290 |
# )
|
| 291 |
# logger.error('%s', APP_TEXT['json_parsing_error'])
|
| 292 |
# logger.error('Additional error info: %s', str(ve))
|
| 293 |
-
st.
|
| 294 |
'Encountered error while parsing JSON...will fix it and retry'
|
| 295 |
)
|
| 296 |
-
logger.
|
| 297 |
'Caught ValueError: trying again after repairing JSON...'
|
| 298 |
)
|
| 299 |
|
|
@@ -302,10 +300,11 @@ def generate_slide_deck(json_str: str):
|
|
| 302 |
slides_template=pptx_template,
|
| 303 |
output_file_path=path
|
| 304 |
)
|
| 305 |
-
_display_download_button(path)
|
| 306 |
except Exception as ex:
|
| 307 |
st.error(APP_TEXT['content_generation_error'])
|
| 308 |
logger.error('Caught a generic exception: %s', str(ex))
|
|
|
|
|
|
|
| 309 |
|
| 310 |
|
| 311 |
def _is_it_refinement() -> bool:
|
|
|
|
| 205 |
},
|
| 206 |
'options': {
|
| 207 |
'wait_for_model': True,
|
|
|
|
| 208 |
'use_cache': True
|
| 209 |
}
|
| 210 |
})
|
|
|
|
| 276 |
slides_template=pptx_template,
|
| 277 |
output_file_path=path
|
| 278 |
)
|
|
|
|
| 279 |
except ValueError:
|
| 280 |
# st.error(
|
| 281 |
# f"{APP_TEXT['json_parsing_error']}"
|
|
|
|
| 288 |
# )
|
| 289 |
# logger.error('%s', APP_TEXT['json_parsing_error'])
|
| 290 |
# logger.error('Additional error info: %s', str(ve))
|
| 291 |
+
st.error(
|
| 292 |
'Encountered error while parsing JSON...will fix it and retry'
|
| 293 |
)
|
| 294 |
+
logger.error(
|
| 295 |
'Caught ValueError: trying again after repairing JSON...'
|
| 296 |
)
|
| 297 |
|
|
|
|
| 300 |
slides_template=pptx_template,
|
| 301 |
output_file_path=path
|
| 302 |
)
|
|
|
|
| 303 |
except Exception as ex:
|
| 304 |
st.error(APP_TEXT['content_generation_error'])
|
| 305 |
logger.error('Caught a generic exception: %s', str(ex))
|
| 306 |
+
finally:
|
| 307 |
+
_display_download_button(path)
|
| 308 |
|
| 309 |
|
| 310 |
def _is_it_refinement() -> bool:
|