Spaces:
Runtime error
Runtime error
Charles Azam commited on
Commit ·
1a1c419
1
Parent(s): 0d89931
fix: images in gradio
Browse files
src/deepengineer/backend/gradio_tools.py
CHANGED
|
@@ -21,7 +21,7 @@ def parse_markdown_images(markdown_text: str, image_dir: Path) -> str:
|
|
| 21 |
alt_text = match.group(1)
|
| 22 |
image_name = match.group(2)
|
| 23 |
# Always use image_dir/image_name
|
| 24 |
-
new_path = str(Path(image_dir) / image_name)
|
| 25 |
return f''
|
| 26 |
|
| 27 |
return re.sub(image_pattern, replace_image_path, markdown_text)
|
|
|
|
| 21 |
alt_text = match.group(1)
|
| 22 |
image_name = match.group(2)
|
| 23 |
# Always use image_dir/image_name
|
| 24 |
+
new_path = "gradio_api/file="+str(Path(image_dir) / image_name)
|
| 25 |
return f''
|
| 26 |
|
| 27 |
return re.sub(image_pattern, replace_image_path, markdown_text)
|
tests/backend/test_gradio_tools.py
CHANGED
|
@@ -72,4 +72,3 @@ def test_parse_markdown_images():
|
|
| 72 |
assert real_image_path.exists()
|
| 73 |
parsed_markdown = parse_markdown_images(markdown, image_dir)
|
| 74 |
assert output_image_path in parsed_markdown
|
| 75 |
-
|
|
|
|
| 72 |
assert real_image_path.exists()
|
| 73 |
parsed_markdown = parse_markdown_images(markdown, image_dir)
|
| 74 |
assert output_image_path in parsed_markdown
|
|
|