Update main_process/moe_router.py
Browse files
main_process/moe_router.py
CHANGED
|
@@ -43,7 +43,7 @@ from main_process.main_router import (
|
|
| 43 |
EMBEDDINGS_ROOT = Path("/data/embeddings")
|
| 44 |
MEDIA_ROOT = Path("/data/media")
|
| 45 |
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
| 46 |
-
router = APIRouter(prefix="/
|
| 47 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 48 |
OPEN_AI_KEY = os.getenv("OPEN_AI_KEY")
|
| 49 |
|
|
@@ -357,13 +357,13 @@ class Valoracion_Final:
|
|
| 357 |
|
| 358 |
return state
|
| 359 |
|
| 360 |
-
@router.post("/
|
| 361 |
async def generate_salamadra_result(
|
| 362 |
sha1: str,
|
| 363 |
token: str = Query(..., description="Token required for authorization")
|
| 364 |
):
|
| 365 |
"""
|
| 366 |
-
Generate all
|
| 367 |
for a processed video identified by its SHA1 hash.
|
| 368 |
|
| 369 |
This endpoint orchestrates the full Salamandra processing pipeline:
|
|
@@ -482,7 +482,7 @@ async def generate_salamadra_result(
|
|
| 482 |
|
| 483 |
return {"status": "ok", "message": "Salamandra SRT, free_narration and CSV evaluation generated"}
|
| 484 |
|
| 485 |
-
@router.get("/
|
| 486 |
def download_salamadra_srt(
|
| 487 |
sha1: str,
|
| 488 |
token: str = Query(..., description="Token required for authorization")
|
|
@@ -532,7 +532,7 @@ def download_salamadra_srt(
|
|
| 532 |
filename="result.srt"
|
| 533 |
)
|
| 534 |
|
| 535 |
-
@router.get("/
|
| 536 |
def download_salamadra_free_narration(
|
| 537 |
sha1: str,
|
| 538 |
token: str = Query(..., description="Token required for authorization")
|
|
@@ -582,7 +582,7 @@ def download_salamadra_free_narration(
|
|
| 582 |
filename="free_narration.tx"
|
| 583 |
)
|
| 584 |
|
| 585 |
-
@router.get("/
|
| 586 |
def download_salamadra_csv_evaluation(
|
| 587 |
sha1: str,
|
| 588 |
token: str = Query(..., description="Token required for authorization")
|
|
|
|
| 43 |
EMBEDDINGS_ROOT = Path("/data/embeddings")
|
| 44 |
MEDIA_ROOT = Path("/data/media")
|
| 45 |
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
| 46 |
+
router = APIRouter(prefix="/moe", tags=["MoE Process"])
|
| 47 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 48 |
OPEN_AI_KEY = os.getenv("OPEN_AI_KEY")
|
| 49 |
|
|
|
|
| 357 |
|
| 358 |
return state
|
| 359 |
|
| 360 |
+
@router.post("/generate_moe_result", tags=["MoE Process"])
|
| 361 |
async def generate_salamadra_result(
|
| 362 |
sha1: str,
|
| 363 |
token: str = Query(..., description="Token required for authorization")
|
| 364 |
):
|
| 365 |
"""
|
| 366 |
+
Generate all MoE output files (final SRT, free narration, and evaluation CSV)
|
| 367 |
for a processed video identified by its SHA1 hash.
|
| 368 |
|
| 369 |
This endpoint orchestrates the full Salamandra processing pipeline:
|
|
|
|
| 482 |
|
| 483 |
return {"status": "ok", "message": "Salamandra SRT, free_narration and CSV evaluation generated"}
|
| 484 |
|
| 485 |
+
@router.get("/download_moe_srt", tags=["MoE Process"])
|
| 486 |
def download_salamadra_srt(
|
| 487 |
sha1: str,
|
| 488 |
token: str = Query(..., description="Token required for authorization")
|
|
|
|
| 532 |
filename="result.srt"
|
| 533 |
)
|
| 534 |
|
| 535 |
+
@router.get("/download_moe_free_narration", tags=["MoE Process"])
|
| 536 |
def download_salamadra_free_narration(
|
| 537 |
sha1: str,
|
| 538 |
token: str = Query(..., description="Token required for authorization")
|
|
|
|
| 582 |
filename="free_narration.tx"
|
| 583 |
)
|
| 584 |
|
| 585 |
+
@router.get("/download_moe_csv_evaluation", tags=["MoE Process"])
|
| 586 |
def download_salamadra_csv_evaluation(
|
| 587 |
sha1: str,
|
| 588 |
token: str = Query(..., description="Token required for authorization")
|