Jangai commited on
Commit
47c05d3
·
verified ·
1 Parent(s): 223a025

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -23,11 +23,11 @@ def display_sketch(sketch):
23
 
24
  plt.imshow(image_data)
25
  plt.axis('off')
26
-
27
- with tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir="/mnt/data") as temp_file:
28
- plt.savefig(temp_file.name, bbox_inches='tight', pad_inches=0)
29
- temp_file_path = temp_file.name
30
-
31
  return temp_file_path
32
  else:
33
  error_message = f"Unexpected sketch data format: {type(sketch)}"
 
23
 
24
  plt.imshow(image_data)
25
  plt.axis('off')
26
+
27
+ temp_file_path = os.path.join(os.getcwd(), "output.png")
28
+ plt.savefig(temp_file_path, bbox_inches='tight', pad_inches=0)
29
+ logging.debug(f"Image saved to: {temp_file_path}")
30
+
31
  return temp_file_path
32
  else:
33
  error_message = f"Unexpected sketch data format: {type(sketch)}"