Spaces:
Build error
Build error
Download app.py from VoxlDev/XenosWSSTT: direct link, hf CLI and curl.
- Browser
- Download file 501 Bytes
-
https://huggingface.co/spaces/VoxlDev/XenosWSSTT/resolve/main/app.py
- Command line
-
hf download hf://spaces/VoxlDev/XenosWSSTT/app.py
-
curl -L -o app.py https://huggingface.co/spaces/VoxlDev/XenosWSSTT/resolve/main/app.py
501 Bytes
| from fastapi import FastAPI, WebSocket, WebSocketDisconnect | |
| app = FastAPI() | |
| async def get(): | |
| return {} | |
| async def websocket_endpoint(websocket: WebSocket): | |
| await websocket.accept() | |
| try: | |
| while True: | |
| data = await websocket.receive_text() | |
| await websocket.send_text(f"Hey, take that back: {data}") | |
| except WebSocketDisconnect: | |
| print("Client disconnected") | |
| except Exception as e: | |
| print(f"Error: {e}") | |