Spaces:
Running on Zero
Running on Zero
Upload 40 files
Browse files- app.py +11 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -7,6 +7,16 @@ from main import app, start_web_server
|
|
| 7 |
logging.basicConfig(level=logging.INFO)
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
async def run_bot_async():
|
| 11 |
try:
|
| 12 |
logger.info("Iniciando servidor interno y cliente Pyrogram...")
|
|
@@ -37,6 +47,7 @@ def start_bot_thread():
|
|
| 37 |
threading.Thread(target=start_bot_thread, daemon=True).start()
|
| 38 |
|
| 39 |
def check_status(user_input):
|
|
|
|
| 40 |
return f"🟢 Bot 'Twisted Audio' activo 24/7 en Telegram. Recibido: {user_input}"
|
| 41 |
|
| 42 |
demo = gr.Interface(
|
|
|
|
| 7 |
logging.basicConfig(level=logging.INFO)
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
+
# Importar spaces y aplicar el decorador @spaces.GPU exigido por ZeroGPU
|
| 11 |
+
try:
|
| 12 |
+
import spaces
|
| 13 |
+
@spaces.GPU
|
| 14 |
+
def gpu_health_check(x):
|
| 15 |
+
return x
|
| 16 |
+
except Exception:
|
| 17 |
+
def gpu_health_check(x):
|
| 18 |
+
return x
|
| 19 |
+
|
| 20 |
async def run_bot_async():
|
| 21 |
try:
|
| 22 |
logger.info("Iniciando servidor interno y cliente Pyrogram...")
|
|
|
|
| 47 |
threading.Thread(target=start_bot_thread, daemon=True).start()
|
| 48 |
|
| 49 |
def check_status(user_input):
|
| 50 |
+
gpu_health_check(user_input)
|
| 51 |
return f"🟢 Bot 'Twisted Audio' activo 24/7 en Telegram. Recibido: {user_input}"
|
| 52 |
|
| 53 |
demo = gr.Interface(
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ tgcrypto
|
|
| 3 |
aiohttp
|
| 4 |
firebase-admin
|
| 5 |
python-dotenv
|
| 6 |
-
ffmpeg-python
|
|
|
|
|
|
| 3 |
aiohttp
|
| 4 |
firebase-admin
|
| 5 |
python-dotenv
|
| 6 |
+
ffmpeg-python
|
| 7 |
+
spaces
|