HachimiMT-demo / app.py
ngocdang83's picture
Init Space: HachimiMT zh-vi demo (CT2, chuẩn hóa xưng hô)
e9015b1 verified
Raw
History Blame
543 Bytes
"""Entrypoint cho HF Space — gọi app trong src/.
HF Space chạy file app.py ở root. App thật nằm trong src/ (dùng import phẳng
như `import translator`), nên thêm src/ vào sys.path rồi gọi main().
Phát hiện Space qua SPACE_ID (đã xử lý trong src/app.py: ẩn nút GPU/torch, bỏ
PID file, để HF tự lo host/port).
"""
import sys
from pathlib import Path
SRC = Path(__file__).resolve().parent / "src"
sys.path.insert(0, str(SRC))
import app as _app # noqa: E402
if __name__ == "__main__":
_app.main()