WHG2023 commited on
Commit
2a4ee49
·
1 Parent(s): 52d7f2a

fix: Use markdown for images to prevent JS errors

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -197,15 +197,15 @@ def run_patent_architect_in_ui(invention_disclosure: str, consent: bool) -> Gene
197
  # Display the Ideogram image if it exists
198
  if state.ideogram_image_b64:
199
  figures_section += "### Conceptual Image (from Ideogram API)\n"
200
- image_html = f"<img src='data:image/jpeg;base64,{state.ideogram_image_b64}' alt='Generated Conceptual Image' style='max-width: 100%; height: auto; border: 2px solid #ff8c00;'>"
201
- figures_section += image_html + "\n\n---\n\n"
202
 
203
  # Display the LaTeX figure description and compiled image if it exists
204
  if state.figure_description:
205
  figures_section += "### Technical Figure (from LaTeX)\n"
206
  compiled_latex_image_uri = compile_latex_to_image(state.figure_description)
207
  if compiled_latex_image_uri:
208
- figures_section += f"<img src='{compiled_latex_image_uri}' alt='Compiled LaTeX Figure' style='max-width: 100%; height: auto; border: 2px solid #00ff41; background: white; padding: 10px;'>\n\n"
209
  else:
210
  figures_section += "*LaTeX compilation failed. Displaying raw code.*\n\n"
211
 
 
197
  # Display the Ideogram image if it exists
198
  if state.ideogram_image_b64:
199
  figures_section += "### Conceptual Image (from Ideogram API)\n"
200
+ image_md = f"![Generated Conceptual Image](data:image/jpeg;base64,{state.ideogram_image_b64})"
201
+ figures_section += image_md + "\n\n---\n\n"
202
 
203
  # Display the LaTeX figure description and compiled image if it exists
204
  if state.figure_description:
205
  figures_section += "### Technical Figure (from LaTeX)\n"
206
  compiled_latex_image_uri = compile_latex_to_image(state.figure_description)
207
  if compiled_latex_image_uri:
208
+ figures_section += f"![Compiled LaTeX Figure]({compiled_latex_image_uri})\n\n"
209
  else:
210
  figures_section += "*LaTeX compilation failed. Displaying raw code.*\n\n"
211