Download debug_ws/test_client.py from lhc-lab/AI-Colab: direct link, hf CLI and curl.
- Browser
- Download file 311 Bytes
-
https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/debug_ws/test_client.py
- Command line
-
hf download hf://datasets/lhc-lab/AI-Colab/debug_ws/test_client.py
-
curl -L -o test_client.py https://huggingface.co/datasets/lhc-lab/AI-Colab/resolve/main/debug_ws/test_client.py
311 Bytes
| import asyncio | |
| import websockets | |
| async def t(): | |
| try: | |
| async with websockets.connect("ws://127.0.0.1:5000/ws/test") as ws: | |
| msg = await ws.recv() | |
| print(f"RECEIVED: {msg}") | |
| except Exception as e: | |
| print(f"ERROR: {e}") | |
| if __name__ == '__main__': | |
| asyncio.run(t()) | |