Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -43,8 +43,8 @@ async def generate_roadmap_endpoint(course_request: CourseRequest):
|
|
43 |
diagram = create_diagram(roadmap_text)
|
44 |
|
45 |
# Render the diagram to a PNG image
|
46 |
-
diagram_path = "/tmp/roadmap"
|
47 |
diagram.render(diagram_path, format='png', cleanup=True)
|
48 |
|
49 |
-
with open(diagram_path
|
50 |
return Response(content=f.read(), media_type="image/png")
|
|
|
43 |
diagram = create_diagram(roadmap_text)
|
44 |
|
45 |
# Render the diagram to a PNG image
|
46 |
+
diagram_path = "/tmp/roadmap.png"
|
47 |
diagram.render(diagram_path, format='png', cleanup=True)
|
48 |
|
49 |
+
with open(diagram_path, "rb") as f:
|
50 |
return Response(content=f.read(), media_type="image/png")
|