ysharma's picture
ysharma HF Staff
add voice input: record or upload a spoken routine, transcribed with Whisper
7191c49 verified
Raw History Blame Contribute Delete
803 Bytes
import os
import sys
import gradio as gr
HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, HERE)
from nodes import choreograph, perform, transcribe # noqa: E402
# Pull the MJCF, meshes and policies during boot (~10 MB, ~45 s cold) so the
# first visitor's run doesn't pay for it. Non-fatal: the sim re-fetches lazily.
try:
import duck
duck.ensure_assets()
print("microduck assets ready")
except Exception as e:
print("microduck asset prefetch failed (" + type(e).__name__ + ": "
+ str(e) + "); will retry on first run")
demo = gr.Workflow(
os.path.join(HERE, "workflow.json"),
bind={"transcribe": transcribe, "choreograph": choreograph,
"perform": perform},
)
if __name__ == "__main__":
demo.launch()