You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @JarbasAl.
* #45 (comment)
The following files were modified:
* `ovos_stt_http_server/__init__.py`
* `ovos_stt_http_server/gradio_app.py`
Create and configure a FastAPI app that exposes STT and language-detection endpoints and returns the app with its model container.
112
+
113
+
Configures CORS origins from the CORS_ORIGINS environment variable, initializes either a single-model or multi-model container using the provided plugins, and registers three endpoints:
114
+
- GET /status: returns service and plugin metadata.
115
+
- POST /stt: accepts raw audio bytes in the request body (query params: `lang`, `sample_rate`, `sample_width`), optionally performs language detection when `lang=auto`, and returns transcribed text.
116
+
- POST /lang_detect: accepts raw audio bytes and returns detected language and confidence (supports `valid_langs` query param).
117
+
118
+
Parameters:
119
+
stt_plugin (str): Name or identifier of the STT plugin to load.
120
+
lang_plugin (str, optional): Name or identifier of an optional language-detection plugin. Defaults to None.
121
+
multi (bool, optional): If True, use a MultiModelContainer (one engine per language); otherwise use a single ModelContainer. Defaults to False.
122
+
has_gradio (bool, optional): Flag included in the /status response indicating whether a Gradio UI is available. Defaults to False.
123
+
124
+
Returns:
125
+
tuple: (app, model) where `app` is the configured FastAPI application and `model` is the initialized ModelContainer or MultiModelContainer instance.
Create and mount a Gradio-based transcription UI at /gradio using the provided STT engine.
38
+
39
+
Initializes the module STT with the given ModelContainer, prepares available language choices and example audio files, constructs a Gradio Interface configured to call the transcribe function, and mounts that interface to the supplied app at path "/gradio". This function logs a deprecation warning for the Gradio interface.
40
+
41
+
Parameters:
42
+
app: The web application or framework instance to which the Gradio interface will be mounted.
43
+
stt_engine (ModelContainer): Speech-to-text engine container used to perform transcriptions and to obtain available languages.
44
+
title (str): Title to display in the Gradio UI.
45
+
description (str): Short description shown in the Gradio UI.
46
+
info (str): Additional informational HTML or text displayed in the Gradio UI article section.
47
+
badge: UI badge metadata (present for API compatibility; not used by this function).
48
+
default_lang (str): Preferred default language code; if not available it will be adjusted or replaced with the first available language.
49
+
cache (bool): Whether to cache example executions to speed up runtime after initial initialization.
50
+
"""
51
+
globalSTT
26
52
LOG.warning("gradio interface is deprecated and will be removed in a follow up release")
0 commit comments