File size: 620 Bytes
7e8db3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
import os
import sys

# Para que Python vea src/mortis
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
SRC_DIR = os.path.join(CURRENT_DIR, "src")
if SRC_DIR not in sys.path:
    sys.path.append(SRC_DIR)

from mortis.app import ui  # o tu función que crea el chatbot

# ⚙️ Hugging Face pasa el puerto en la variable PORT
port = int(os.getenv("PORT", "7860"))

demo = ui()  # aquí dentro montas tu Chatbot/ChatInterface

if __name__ == "__main__":
    demo.launch(
        server_name="0.0.0.0",      # ¡IMPORTANTE en Docker!
        server_port=port,
        show_error=True,
    )