tencent/AuK

Space

24

stars

17

commits

1

linked in READMEs

Sep 10, 2026

updated

gradio

README

AuK Space

This Gradio Space follows the public Tencent-Hunyuan/AuK source at commit e3828bdac1712bbf7bcb3a2a01eec6fa5168fe32. The vendored inference/model files under src/ and every example audio referenced by that revision are copied unchanged, including pe.py, pe.config.yaml, and the VAE's packaged assets. Platform adaptations live in app.py.

The interface includes both official variants:

  • AuK-Flash uses its fixed 4-step, CFG-free distilled recipe.
  • AuK Base exposes NFE and classifier-free guidance controls.

Both variants share one Qwen2.5-Omni-3B text/audio encoder. The application also compares the two VAE files and configurations and shares one VAE instance only when both match. Factory replacements are scoped to startup and restored before serving requests; generation and checkpoint loading use upstream code.

Space secrets and variables

Configure these names in Settings → Variables and secrets. They are read directly from the process environment. There is no .env upload step and the application does not load a local .env file.

NamePurposeRequirement
HF_TOKENRead private/gated model releasesNeeded if the selected models require authentication
LLM_API_KEYPrompt Enhancer's OpenAI-compatible LLM credentialRequired when Prompt Enhancer is enabled
LLM_BASE_URLLLM API base URL, e.g. the provider's HTTPS /v1 baseRequired when Prompt Enhancer is enabled
LLM_MODEL_NAMEExact provider model IDRequired when Prompt Enhancer is enabled; no assumed default
TENCENTCLOUD_SECRET_IDTencent Cloud ASR credential IDNeeded for cloud ASR
TENCENTCLOUD_SECRET_KEYTencent Cloud ASR credential keyNeeded for cloud ASR
ASR_ENGINE_MODEL_TYPETencent Cloud recognition engineOptional; upstream default is 16k_zh_en

All seven can remain Secrets, as in the Space settings. Non-credential settings may also be ordinary Variables. Startup checks report missing names only, without printing their values or calling a provider. Presence checks do not prove a credential is valid or has the necessary permissions.

The Prompt Enhancer checkbox, metadata fields, and Base/Flash sampling controls are built by the original infer_gradio.build_demo(). The Space adapter keeps Prompt Enhancer optional and enabled by default. While enabled, duration 0 asks Prompt Enhancer to estimate the duration automatically, while a value above 0 overrides that estimate. Turning it off makes an explicit, finite duration greater than 0 seconds required, even with reference audio or text. Blank or zero duration is rejected before GPU allocation; it cannot trigger automatic duration inference in manual mode. The slider accepts up to 30 seconds. The task-grouped examples populate the input audio, instruction, target duration, Prompt Enhancer toggle, and seed through the upstream Gradio callbacks. When enabled, Prompt Enhancer reads the LLM settings and uses Tencent Cloud recording ASR for uploaded audio. Missing credentials or cloud ASR failure fall back to upstream SenseVoiceSmall on CPU; its model downloads on first use. Manual mode remains usable without LLM credentials.

Only run_generate() is wrapped with spaces.GPU. LLM calls, cloud/local ASR, VAD, and temporary-audio cleanup run outside the GPU allocation. The complete request is serialized with concurrency 1 and a queue capacity of 16.

Do not expose credentials in browser components, logs, or error responses. The deployment callback redacts configured values from user-facing errors. Public access can still consume the configured LLM/ASR quotas; use provider spending limits and access controls appropriate to the deployment.

Runtime compatibility

The Space keeps Python 3.10, Gradio 6.16.0, and the existing Torch 2.11.0 family. The spaces SDK accepts version 0.51.1 or newer; HF selects its exact version in the generated build command to avoid conflicting application/platform pins. Upstream's package metadata targets Torch 2.7; the Space pins its own runtime because ZeroGPU supports Torch 2.8 and newer. Do not install the upstream project with pip install -e . in this Space.

TorchAudio's newer I/O API differs from the upstream 2.7 API. SpaceAudioIO in app.py supplies local-file info, load, and PCM16 WAV save through SoundFile for AuK and Prompt Enhancer only. Formats outside libsndfile (such as AAC/M4A) fall back to the pinned TorchCodec/FFmpeg stack. Resampling still uses TorchAudio. No source algorithms or prompt recipes are changed.

Models load during startup, before accepting requests. ZeroGPU emulates CUDA placement at that point. GPU generation has a 300-second allocation limit; this is a timeout budget, not a measured latency or performance guarantee. The upstream Soft theme and DEMO_CSS are passed to Gradio's launch().

Private model repositories

Hugging Face cannot build-time preload private repositories. While tencent/AuK or tencent/AuK-Flash is private, add a read-only user access token to Settings → Secrets with the name HF_TOKEN. Once both repositories are public, the same code downloads them without a secret.

Optional deployment variables:

  • AUK_REVISION: AuK revision, default main
  • AUK_FLASH_REVISION: AuK-Flash revision, default main
  • AUK_HF_HOME: writable Hugging Face cache, default /tmp/auk-huggingface; a persistent volume can use /data/.huggingface

All models are downloaded at startup into the configured cache. Build-time preloading is intentionally omitted: it would populate a different default cache and duplicate downloads. For reproducible releases, set the model revision variables to immutable model commits in addition to the source commit above.

Local validation and publishing

tests/test_space.py exercises the real Gradio interface and real Prompt Enhancer configuration with model/provider doubles. It does not download AuK weights, consume API credits, or establish GPU inference quality. Install pytest and ruff in the test environment in addition to the runtime dependencies. Set AUK_SOURCE_REPO to the canonical local checkout to enable the byte-for-byte provenance test. Native WeTextProcessing/Pynini setup on macOS may need OpenFST; the deployment target uses Linux binary wheels.

python -m pytest -q tests
ruff check app.py tests
ruff format --check app.py tests
git diff --check

Before publishing, review the Space diff and ensure no real .env/credentials are staged. Pushing this repository's main branch triggers an HF rebuild. After a separately approved push, verify a fresh startup, the live UI, one manual generation, and one Prompt Enhancer request with cloud ASR as applicable.

Contributors

zkniu

16 commits

TencentOpen

1 commits

tencent/AuK

Space

24

stars

17

commits

1

linked in READMEs

Sep 10, 2026

updated

gradio

README

AuK Space

This Gradio Space follows the public Tencent-Hunyuan/AuK source at commit e3828bdac1712bbf7bcb3a2a01eec6fa5168fe32. The vendored inference/model files under src/ and every example audio referenced by that revision are copied unchanged, including pe.py, pe.config.yaml, and the VAE's packaged assets. Platform adaptations live in app.py.

The interface includes both official variants:

  • AuK-Flash uses its fixed 4-step, CFG-free distilled recipe.
  • AuK Base exposes NFE and classifier-free guidance controls.

Both variants share one Qwen2.5-Omni-3B text/audio encoder. The application also compares the two VAE files and configurations and shares one VAE instance only when both match. Factory replacements are scoped to startup and restored before serving requests; generation and checkpoint loading use upstream code.

Space secrets and variables

Configure these names in Settings → Variables and secrets. They are read directly from the process environment. There is no .env upload step and the application does not load a local .env file.

NamePurposeRequirement
HF_TOKENRead private/gated model releasesNeeded if the selected models require authentication
LLM_API_KEYPrompt Enhancer's OpenAI-compatible LLM credentialRequired when Prompt Enhancer is enabled
LLM_BASE_URLLLM API base URL, e.g. the provider's HTTPS /v1 baseRequired when Prompt Enhancer is enabled
LLM_MODEL_NAMEExact provider model IDRequired when Prompt Enhancer is enabled; no assumed default
TENCENTCLOUD_SECRET_IDTencent Cloud ASR credential IDNeeded for cloud ASR
TENCENTCLOUD_SECRET_KEYTencent Cloud ASR credential keyNeeded for cloud ASR
ASR_ENGINE_MODEL_TYPETencent Cloud recognition engineOptional; upstream default is 16k_zh_en

All seven can remain Secrets, as in the Space settings. Non-credential settings may also be ordinary Variables. Startup checks report missing names only, without printing their values or calling a provider. Presence checks do not prove a credential is valid or has the necessary permissions.

The Prompt Enhancer checkbox, metadata fields, and Base/Flash sampling controls are built by the original infer_gradio.build_demo(). The Space adapter keeps Prompt Enhancer optional and enabled by default. While enabled, duration 0 asks Prompt Enhancer to estimate the duration automatically, while a value above 0 overrides that estimate. Turning it off makes an explicit, finite duration greater than 0 seconds required, even with reference audio or text. Blank or zero duration is rejected before GPU allocation; it cannot trigger automatic duration inference in manual mode. The slider accepts up to 30 seconds. The task-grouped examples populate the input audio, instruction, target duration, Prompt Enhancer toggle, and seed through the upstream Gradio callbacks. When enabled, Prompt Enhancer reads the LLM settings and uses Tencent Cloud recording ASR for uploaded audio. Missing credentials or cloud ASR failure fall back to upstream SenseVoiceSmall on CPU; its model downloads on first use. Manual mode remains usable without LLM credentials.

Only run_generate() is wrapped with spaces.GPU. LLM calls, cloud/local ASR, VAD, and temporary-audio cleanup run outside the GPU allocation. The complete request is serialized with concurrency 1 and a queue capacity of 16.

Do not expose credentials in browser components, logs, or error responses. The deployment callback redacts configured values from user-facing errors. Public access can still consume the configured LLM/ASR quotas; use provider spending limits and access controls appropriate to the deployment.

Runtime compatibility

The Space keeps Python 3.10, Gradio 6.16.0, and the existing Torch 2.11.0 family. The spaces SDK accepts version 0.51.1 or newer; HF selects its exact version in the generated build command to avoid conflicting application/platform pins. Upstream's package metadata targets Torch 2.7; the Space pins its own runtime because ZeroGPU supports Torch 2.8 and newer. Do not install the upstream project with pip install -e . in this Space.

TorchAudio's newer I/O API differs from the upstream 2.7 API. SpaceAudioIO in app.py supplies local-file info, load, and PCM16 WAV save through SoundFile for AuK and Prompt Enhancer only. Formats outside libsndfile (such as AAC/M4A) fall back to the pinned TorchCodec/FFmpeg stack. Resampling still uses TorchAudio. No source algorithms or prompt recipes are changed.

Models load during startup, before accepting requests. ZeroGPU emulates CUDA placement at that point. GPU generation has a 300-second allocation limit; this is a timeout budget, not a measured latency or performance guarantee. The upstream Soft theme and DEMO_CSS are passed to Gradio's launch().

Private model repositories

Hugging Face cannot build-time preload private repositories. While tencent/AuK or tencent/AuK-Flash is private, add a read-only user access token to Settings → Secrets with the name HF_TOKEN. Once both repositories are public, the same code downloads them without a secret.

Optional deployment variables:

  • AUK_REVISION: AuK revision, default main
  • AUK_FLASH_REVISION: AuK-Flash revision, default main
  • AUK_HF_HOME: writable Hugging Face cache, default /tmp/auk-huggingface; a persistent volume can use /data/.huggingface

All models are downloaded at startup into the configured cache. Build-time preloading is intentionally omitted: it would populate a different default cache and duplicate downloads. For reproducible releases, set the model revision variables to immutable model commits in addition to the source commit above.

Local validation and publishing

tests/test_space.py exercises the real Gradio interface and real Prompt Enhancer configuration with model/provider doubles. It does not download AuK weights, consume API credits, or establish GPU inference quality. Install pytest and ruff in the test environment in addition to the runtime dependencies. Set AUK_SOURCE_REPO to the canonical local checkout to enable the byte-for-byte provenance test. Native WeTextProcessing/Pynini setup on macOS may need OpenFST; the deployment target uses Linux binary wheels.

python -m pytest -q tests
ruff check app.py tests
ruff format --check app.py tests
git diff --check

Before publishing, review the Space diff and ensure no real .env/credentials are staged. Pushing this repository's main branch triggers an HF rebuild. After a separately approved push, verify a fresh startup, the live UI, one manual generation, and one Prompt Enhancer request with cloud ASR as applicable.

Contributors

zkniu

16 commits

TencentOpen

1 commits