Spaces:
Runtime error
Runtime error
added prints to spot error causes
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
elif mode == 'classic':
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
else:
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 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;">
|