Skip to content

Commit

Permalink
Added traceback for bug tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyondo committed Apr 16, 2023
1 parent 572bc1a commit 666be19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions legacy/img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from legacy import colab, postprocessor, progress
from IPython.display import display, HTML, Image

import requests
import requests, traceback
from PIL import Image
from io import BytesIO
importlib.reload(progress)
Expand Down Expand Up @@ -49,5 +49,5 @@ def process(ShouldSave, maxNumJobs, ShouldPreview = True, ReplaceResult = True):
display(HTML("<label>Iterations: %d/%d</label>" % (i + 1, num_iterations)), display_id="iterations")
postprocessor.join_queue_thread()
torch.cuda.empty_cache()
except Exception as e:
print("Error trying to generate image: " + str(e))
except Exception:
print("Error trying to generate image", traceback.format_exc())
7 changes: 5 additions & 2 deletions legacy/text2img.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import torch, os, time, datetime, importlib
from legacy import colab, postprocessor, progress
from IPython.display import display, HTML

import traceback

importlib.reload(progress)
importlib.reload(postprocessor)
def process(ShouldSave, maxNumJobs, ShouldPreview = True, ReplaceResult = True):
Expand Down Expand Up @@ -37,5 +40,5 @@ def process(ShouldSave, maxNumJobs, ShouldPreview = True, ReplaceResult = True):
display(HTML("<label>Iterations: %d/%d</label>" % (i + 1, num_iterations)), display_id="iterations")
postprocessor.join_queue_thread()
torch.cuda.empty_cache()
except Exception as e:
print("Error trying to generate image: " + str(e))
except Exception:
print("Error trying to generate image", traceback.format_exc())

0 comments on commit 666be19

Please sign in to comment.