LPX55 commited on
Commit
a1816dd
·
verified ·
1 Parent(s): e6a600e

Update debug.py

Browse files
Files changed (1) hide show
  1. debug.py +15 -14
debug.py CHANGED
@@ -29,7 +29,7 @@ scheduler = CommitScheduler(
29
 
30
  def cache_temp(img_id):
31
  api.upload_file(
32
- path_or_fileobj=os.path.join("/tmp/logs_0_4/upscaler", f"{image_id}"),
33
 
34
  path_in_repo="/v" + APP_VERSION + "/" + img_id,
35
  repo_id=HF_DATASET_REPO,
@@ -45,23 +45,24 @@ def save_image(image_id, image_path: Image.Image) -> None:
45
  try:
46
  loaded = load_image(image_path)
47
  print("Loaded Type: " + str(type(loaded)))
48
- except Exception as e:
49
- print(f"Error loading image: {str(e)}")
50
- with scheduler.lock:
51
- try:
52
- cache_temp(save_image_path)
53
- # print("Image path: " + image_path)
54
- print("Type: " + str(type(image_path)))
55
  try:
56
- # img2 = img2.open(img)
57
- loaded.save(save_image_path)
58
-
59
- print(f"Saved image: {save_image_path}")
 
 
 
 
 
 
 
60
  except Exception as e:
61
  print(f"Error saving image: {str(e)}")
62
 
63
- except Exception as e:
64
- print(f"Error saving image: {str(e)}")
65
 
66
  def log_params(
67
  prompt, scale, steps, controlnet_conditioning_scale, guidance_scale, seed, guidance_end,
 
29
 
30
  def cache_temp(img_id):
31
  api.upload_file(
32
+ path_or_fileobj=os.path.join("/tmp/logs_0_4/upscaler", f"{img_id}"),
33
 
34
  path_in_repo="/v" + APP_VERSION + "/" + img_id,
35
  repo_id=HF_DATASET_REPO,
 
45
  try:
46
  loaded = load_image(image_path)
47
  print("Loaded Type: " + str(type(loaded)))
48
+ with scheduler.lock:
 
 
 
 
 
 
49
  try:
50
+ cache_temp(save_image_path)
51
+ # print("Image path: " + image_path)
52
+ print("Type: " + str(type(image_path)))
53
+ try:
54
+ # img2 = img2.open(img)
55
+ loaded.save(save_image_path)
56
+
57
+ print(f"Saved image: {save_image_path}")
58
+ except Exception as e:
59
+ print(f"Error saving image: {str(e)}")
60
+
61
  except Exception as e:
62
  print(f"Error saving image: {str(e)}")
63
 
64
+ except Exception as e:
65
+ print(f"Error loading image: {str(e)}")
66
 
67
  def log_params(
68
  prompt, scale, steps, controlnet_conditioning_scale, guidance_scale, seed, guidance_end,