File size: 1,103 Bytes
5f0f535
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Switches for leaderboard tracks that are not released yet.

Speaker diarization and full-duplex voice agents are built but switched off by default. With a
switch off, its leaderboard track, Analysis view, Listen clips, Methodology section and Submit
option are not built at all, and the server refuses submissions for it. Set the variable to
``1`` on a Space (for example the test Space) to preview a track:

    FFASR_ENABLE_DIARIZATION   speaker diarization track and diarization submissions
    FFASR_ENABLE_DUPLEX        full-duplex voice agent track (read-only)
"""

from __future__ import annotations

import os

_TRUTHY = ("1", "true", "yes", "on")


def _on(name: str) -> bool:
    return os.environ.get(name, "").strip().lower() in _TRUTHY


def diarization_enabled() -> bool:
    return _on("FFASR_ENABLE_DIARIZATION")


def duplex_enabled() -> bool:
    return _on("FFASR_ENABLE_DUPLEX")


def enabled_tracks() -> list[str]:
    """Leaderboard tracks to show, ASR first."""
    return ["asr"] + (["diarization"] if diarization_enabled() else []) + (["duplex"] if duplex_enabled() else [])