fffiloni commited on
Commit
7ff6bed
1 Parent(s): 6a6ce5d

added prints to spot error causes

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -45,11 +45,20 @@ ci = Interrogator(config)
45
  def inference(image, mode, best_max_flavors):
46
  image = image.convert('RGB')
47
  if mode == 'best':
48
- return ci.interrogate(image, max_flavors=int(best_max_flavors)), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
 
 
 
49
  elif mode == 'classic':
50
- return ci.interrogate_classic(image), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
 
 
 
51
  else:
52
- return ci.interrogate_fast(image), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
 
 
 
53
 
54
  title = """
55
  <div style="text-align: center; max-width: 500px; margin: 0 auto;">
 
45
  def inference(image, mode, best_max_flavors):
46
  image = image.convert('RGB')
47
  if mode == 'best':
48
+ print("mode: best")
49
+ prompt_result = ci.interrogate(image, max_flavors=int(best_max_flavors))
50
+ print(prompt_result)
51
+ return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
52
  elif mode == 'classic':
53
+ print("mode: classic")
54
+ prompt_result = ci.interrogate_classic(image)
55
+ print(prompt_result)
56
+ return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
57
  else:
58
+ print("mode: fast")
59
+ prompt_result = ci.interrogate_fast(image)
60
+ print(prompt_result)
61
+ return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
62
 
63
  title = """
64
  <div style="text-align: center; max-width: 500px; margin: 0 auto;">