Skip to content

Commit

Permalink
SulkuMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
Moibe committed Dec 9, 2024
1 parent f5f50fc commit 525a2f4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
3 changes: 2 additions & 1 deletion funciones.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def perform(input1, request: gr.Request):
if autorizacion is True:
try:
resultado = mass(input1)
print("El resultado de mass es: ")
print(resultado)
#El resultado ya viene detuplado.
except Exception as e:
info_window, resultado, html_credits = sulkuFront.aError(request.username, tokens, excepcion = tools.titulizaExcepDeAPI(e))
Expand Down Expand Up @@ -56,7 +58,6 @@ def mass(input1):
#client = gradio_client.Client("https://058d1a6dcdbaca0dcf.gradio.live/") #MiniProxy

imagenSource = gradio_client.handle_file(input1)
print("Ésto es imagenSource después de ser procesada: ", imagenSource)
imagenPosition = gradio_client.handle_file(splash_tools.getPosition())
creacion=splash_tools.creadorObjeto()
prompt = prompter.prompteador(creacion)
Expand Down
2 changes: 1 addition & 1 deletion globales.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gradio as gr

#MAIN
version = "4.6.15"
version = "4.7.15"
env = "dev"
aplicacion = "superheroes-dev" #como se llama en tu repo y tu dominio.
#api = "Moibe/splashmix"
Expand Down
18 changes: 9 additions & 9 deletions sulkuFront.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sulkuPypi
import gradio as gr
import threading
from huggingface_hub import HfApi
import sulkuMessages

result_from_displayTokens = None
result_from_initAPI = None
Expand Down Expand Up @@ -67,23 +67,23 @@ def aError(usuario, tokens, excepcion):
def manejadorExcepciones(excepcion):
#El parámetro que recibe es el texto despliega ante determinada excepción:
if excepcion == "PAUSED":
info_window = "AI Engine Paused, ready soon."
info_window = sulkuMessages.PAUSED
elif excepcion == "RUNTIME_ERROR":
info_window = "Error building AI environment, please contact me."
info_window = sulkuMessages.RUNTIME_ERROR
elif excepcion == "STARTING":
info_window = "Server Powering UP, wait a few minutes and try again."
info_window = sulkuMessages.STARTING
elif excepcion == "HANDSHAKE_ERROR":
info_window = "Connection error try again."
info_window = sulkuMessages.HANDSHAKE_ERROR
elif excepcion == "GENERAL":
info_window = "Network error, no credits were debited."
info_window = sulkuMessages.GENERAL
elif excepcion == "NO_FACE":
info_window = "Unable to detect a face in the image. Please upload a different photo with a clear face."
info_window = sulkuMessages.NO_FACE
elif excepcion == "NO_FILE":
info_window = "No file, please add a valid archive."
info_window = sulkuMessages.NO_FILE
elif "quota" in excepcion: #Caso especial porque el texto cambiará citando la cuota.
info_window = excepcion
else:
info_window = "Error. No credits were debited."
info_window = sulkuMessages.ELSE

return info_window

Expand Down
12 changes: 12 additions & 0 deletions sulkuMessages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
result_ok = "Result ready!"

out_of_credits = "Out of credits..."

PAUSED = "AI Engine Paused, ready soon."
RUNTIME_ERROR= "Error building AI environment, please contact me."
STARTING = "Server Powering UP, wait a few minutes and try again."
HANDSHAKE_ERROR = "Connection error try again."
GENERAL = "Network error, no credits were debited."
NO_FACE = "Unable to detect a face in the image. Please upload a different photo with a clear face."
NO_FILE = "No file, please add a valid archive."
ELSE = "Error. No credits were debited."
Empty file removed terminal_messages.py
Empty file.

0 comments on commit 525a2f4

Please sign in to comment.