Add text mode (#321)

* Pretty good spot

* Working draft

* Fix other mode

* Add js to git

* Working

* Add code

* fix

* Fix

* Add code

* Fix submit race condition

* demo

* fix

* Fix

* Fix
This commit is contained in:
Freddy Boulton
2025-06-03 19:24:21 -04:00
committed by GitHub
parent 1179f8ef21
commit 1877720231
69 changed files with 110161 additions and 22889 deletions

View File

@@ -17,6 +17,7 @@ import av
import librosa
import numpy as np
from fastapi import WebSocket
from gradio.data_classes import GradioModel, GradioRootModel
from numpy.typing import NDArray
from pydub import AudioSegment
@@ -31,6 +32,16 @@ class AudioChunk(TypedDict):
end: int
class WebRTCData(GradioModel):
webrtc_id: str
textbox: str = ""
audio: Any | None = None
class WebRTCModel(GradioRootModel):
root: WebRTCData | str
class AdditionalOutputs:
def __init__(self, *args) -> None:
self.args = args