Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,40 +46,25 @@ def inference(image, mode, best_max_flavors):
|
|
46 |
image = image.convert('RGB')
|
47 |
if mode == 'best':
|
48 |
|
49 |
-
print("""ββββ
|
50 |
-
new inference
|
51 |
-
mode: best
|
52 |
-
""")
|
53 |
-
|
54 |
prompt_result = ci.interrogate(image, max_flavors=int(best_max_flavors))
|
55 |
|
56 |
-
print(prompt_result)
|
57 |
|
58 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
59 |
|
60 |
elif mode == 'classic':
|
61 |
|
62 |
-
print("""ββββ
|
63 |
-
new inference
|
64 |
-
mode: classic
|
65 |
-
""")
|
66 |
-
|
67 |
prompt_result = ci.interrogate_classic(image)
|
68 |
|
69 |
-
print(prompt_result)
|
70 |
|
71 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
72 |
|
73 |
else:
|
74 |
|
75 |
-
print("""ββββ
|
76 |
-
new inference
|
77 |
-
mode: best
|
78 |
-
""")
|
79 |
-
|
80 |
prompt_result = ci.interrogate_fast(image)
|
81 |
|
82 |
-
print(prompt_result)
|
83 |
|
84 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
85 |
|
|
|
46 |
image = image.convert('RGB')
|
47 |
if mode == 'best':
|
48 |
|
|
|
|
|
|
|
|
|
|
|
49 |
prompt_result = ci.interrogate(image, max_flavors=int(best_max_flavors))
|
50 |
|
51 |
+
print("mode best: " + prompt_result)
|
52 |
|
53 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
54 |
|
55 |
elif mode == 'classic':
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
prompt_result = ci.interrogate_classic(image)
|
58 |
|
59 |
+
print("mode classic: " + prompt_result)
|
60 |
|
61 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
62 |
|
63 |
else:
|
64 |
|
|
|
|
|
|
|
|
|
|
|
65 |
prompt_result = ci.interrogate_fast(image)
|
66 |
|
67 |
+
print("mode fast: " + prompt_result)
|
68 |
|
69 |
return prompt_result, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
70 |
|