Spaces:
Sleeping
Sleeping
Credits as output
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def perform(input1, input2):
|
|
53 |
else:
|
54 |
info_window = "Out of credits..."
|
55 |
path = 'no-result.png'
|
56 |
-
return path, info_window, btn_buy
|
57 |
|
58 |
print(f"El path final fue {path}, si es no-result, no debites y controla la info window.")
|
59 |
print(f"El type de path es: ", type(path))
|
@@ -71,17 +71,20 @@ def perform(input1, input2):
|
|
71 |
#Y finalmente debita los tokens.
|
72 |
gr.State.tokens = sulkuPypi.debitTokens(gr.State.capsule, "picswap")
|
73 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
|
|
|
|
|
|
74 |
info_window = "Image ready!"
|
75 |
|
76 |
else:
|
77 |
print("No se detect贸 un rostro...")
|
78 |
info_window = "No face in source path detected."
|
79 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
80 |
-
|
81 |
#No se hizo un proceso, por lo tanto no debitaremos.
|
82 |
#En el futuro, como regla de negocio, podr铆a cambiar y que si debitemos.
|
83 |
|
84 |
-
return path, info_window, btn_buy
|
85 |
|
86 |
def click_buy():
|
87 |
|
@@ -118,6 +121,7 @@ html_credits = gr.HTML("""
|
|
118 |
<div style="text-align: right;">馃挾<b>Credits Available:</b> 206</div>
|
119 |
""")
|
120 |
|
|
|
121 |
|
122 |
lbl_console = gr.Label(label="AI Terminal Messages", value="AI Engine ready...", container=True)
|
123 |
btn_buy = gr.Button("Buy More", visible=False, size='lg')
|
|
|
53 |
else:
|
54 |
info_window = "Out of credits..."
|
55 |
path = 'no-result.png'
|
56 |
+
return path, info_window, html_credits, btn_buy
|
57 |
|
58 |
print(f"El path final fue {path}, si es no-result, no debites y controla la info window.")
|
59 |
print(f"El type de path es: ", type(path))
|
|
|
71 |
#Y finalmente debita los tokens.
|
72 |
gr.State.tokens = sulkuPypi.debitTokens(gr.State.capsule, "picswap")
|
73 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
74 |
+
html_credits = """
|
75 |
+
<div style="text-align: right;">馃挾<b>Credits Available:</b> 20</div>
|
76 |
+
"""
|
77 |
info_window = "Image ready!"
|
78 |
|
79 |
else:
|
80 |
print("No se detect贸 un rostro...")
|
81 |
info_window = "No face in source path detected."
|
82 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
83 |
+
|
84 |
#No se hizo un proceso, por lo tanto no debitaremos.
|
85 |
#En el futuro, como regla de negocio, podr铆a cambiar y que si debitemos.
|
86 |
|
87 |
+
return path, info_window, html_credits, btn_buy
|
88 |
|
89 |
def click_buy():
|
90 |
|
|
|
121 |
<div style="text-align: right;">馃挾<b>Credits Available:</b> 206</div>
|
122 |
""")
|
123 |
|
124 |
+
html_credits.
|
125 |
|
126 |
lbl_console = gr.Label(label="AI Terminal Messages", value="AI Engine ready...", container=True)
|
127 |
btn_buy = gr.Button("Buy More", visible=False, size='lg')
|