Spaces:
Running
Running
Improve performance
Browse files- globales.py +2 -11
- herramientas.py +1 -33
globales.py
CHANGED
@@ -2,7 +2,7 @@ import autenticacion
|
|
2 |
|
3 |
#previo = "Una fotografía de un plato blanco con "
|
4 |
#previo = "A photograph of a white plate with a visually appealing culinary dish of "
|
5 |
-
previo = "A pic of a white plate with a
|
6 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
7 |
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|
@@ -12,13 +12,4 @@ proveedor = "hf-inference" #falai
|
|
12 |
proveedor_back = "fal-ai"
|
13 |
work_cost = 1 #Los segundos que cuesta la generación de una imagen, para control de la capa gratuita.
|
14 |
inference_cost = 1
|
15 |
-
quota = 1500
|
16 |
-
|
17 |
-
# espacio = [
|
18 |
-
# "black-forest-labs/FLUX.1-dev",
|
19 |
-
# #"black-forest-labs/FLUX.1-schnell",
|
20 |
-
# "NihalGazi/FLUX-Pro-Unlimited",
|
21 |
-
# #"HiDream-ai/HiDream-I1-Dev",
|
22 |
-
# #"stabilityai/stable-diffusion"
|
23 |
-
|
24 |
-
# ]
|
|
|
2 |
|
3 |
#previo = "Una fotografía de un plato blanco con "
|
4 |
#previo = "A photograph of a white plate with a visually appealing culinary dish of "
|
5 |
+
previo = "A pic of a white plate with a culinary dish of "
|
6 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
7 |
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|
|
|
12 |
proveedor_back = "fal-ai"
|
13 |
work_cost = 1 #Los segundos que cuesta la generación de una imagen, para control de la capa gratuita.
|
14 |
inference_cost = 1
|
15 |
+
quota = 1500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
herramientas.py
CHANGED
@@ -38,7 +38,7 @@ def renuevaSegundosDisponibles():
|
|
38 |
|
39 |
def renuevaTimestampActual():
|
40 |
|
41 |
-
timestamp_actual =
|
42 |
conexion_firebase.editaDato('nowme', servidor, 'timestamp', timestamp_actual)
|
43 |
|
44 |
def restaSegundosGPU(cuantos_segundos):
|
@@ -96,38 +96,6 @@ def imprimeTimeNow():
|
|
96 |
|
97 |
return formatted_time
|
98 |
|
99 |
-
def imprimeTimeNowFixed16h():
|
100 |
-
"""
|
101 |
-
Devuelve la fecha actual con la hora fijada a las 16:00:00 (4 PM)
|
102 |
-
en la zona horaria de la Ciudad de México (GMT-6).
|
103 |
-
"""
|
104 |
-
# 1. Definir la zona horaria de la Ciudad de México
|
105 |
-
mexico_city_tz = pytz.timezone('America/Mexico_City')
|
106 |
-
|
107 |
-
# 2. Obtener la fecha y hora actual en UTC
|
108 |
-
utc_now = datetime.now(pytz.utc)
|
109 |
-
|
110 |
-
# 3. Convertir la hora UTC a la zona horaria de la Ciudad de México
|
111 |
-
# Esto nos da la fecha correcta (año, mes, día) para esa zona.
|
112 |
-
mexico_city_aware_dt = utc_now.astimezone(mexico_city_tz)
|
113 |
-
|
114 |
-
# 4. Crear un nuevo objeto datetime con la fecha obtenida
|
115 |
-
# pero con la hora fijada a las 16:00:00
|
116 |
-
fixed_time_dt = mexico_city_tz.localize(
|
117 |
-
datetime(
|
118 |
-
mexico_city_aware_dt.year,
|
119 |
-
mexico_city_aware_dt.month,
|
120 |
-
mexico_city_aware_dt.day,
|
121 |
-
16,
|
122 |
-
0,
|
123 |
-
0
|
124 |
-
)
|
125 |
-
)
|
126 |
-
|
127 |
-
# 5. Formatear la fecha y hora
|
128 |
-
formatted_time = fixed_time_dt.strftime("%Y-%m-%d %H:%M:%S")
|
129 |
-
return formatted_time
|
130 |
-
|
131 |
def siEsDiaSiguienteRenueva():
|
132 |
|
133 |
#Obtiene el último registro de fecha de la base de firestore.
|
|
|
38 |
|
39 |
def renuevaTimestampActual():
|
40 |
|
41 |
+
timestamp_actual = imprimeTimeNow()
|
42 |
conexion_firebase.editaDato('nowme', servidor, 'timestamp', timestamp_actual)
|
43 |
|
44 |
def restaSegundosGPU(cuantos_segundos):
|
|
|
96 |
|
97 |
return formatted_time
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
def siEsDiaSiguienteRenueva():
|
100 |
|
101 |
#Obtiene el último registro de fecha de la base de firestore.
|