Spaces:
Runtime error
Runtime error
Download app.py from auszed/simple_demo: direct link, hf CLI and curl.
- Browser
- Download file 629 Bytes
-
https://huggingface.co/spaces/auszed/simple_demo/resolve/main/app.py
- Command line
-
hf download hf://spaces/auszed/simple_demo/app.py
-
curl -L -o app.py https://huggingface.co/spaces/auszed/simple_demo/resolve/main/app.py
629 Bytes
| from fastrtc import Stream, ReplyOnPause | |
| import numpy as np | |
| from fastrtc import WebRTC, get_hf_turn_credentials | |
| def echo(audio: tuple[int, np.ndarray]): | |
| # The function will be passed the audio until the user pauses | |
| # Implement any iterator that yields audio | |
| # See "LLM Voice Chat" for a more complete example | |
| yield audio | |
| stream = Stream( | |
| handler=ReplyOnPause(echo), | |
| modality="audio", | |
| mode="send-receive", | |
| server_rtc_configuration=get_hf_turn_credentials(ttl=600*10000), | |
| rtc_configuration=get_hf_turn_credentials(), | |
| time_limit=90, | |
| concurrency_limit=5, | |
| ) | |
| stream.ui.launch(port=7860) |