Spaces:
Runtime error
Runtime error
Download socket_client.py from manhdo/Alphii-article-generator: direct link, hf CLI and curl.
- Browser
- Download file 605 Bytes
-
https://huggingface.co/spaces/manhdo/Alphii-article-generator/resolve/main/socket_client.py
- Command line
-
hf download hf://spaces/manhdo/Alphii-article-generator/socket_client.py
-
curl -L -o socket_client.py https://huggingface.co/spaces/manhdo/Alphii-article-generator/resolve/main/socket_client.py
605 Bytes
| import socketio | |
| import logging | |
| import coloredlogs | |
| import asyncio | |
| import streamlit as st | |
| coloredlogs.install(level="INFO", | |
| fmt="%(asctime)s %(name)s %(funcName)s() %(filename)s %(lineno)d %(levelname)-8s %(message)s") | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger(__name__) | |
| END_OF_SENTENCE = "<EOS>" | |
| sio = socketio.Client() | |
| chunk_list = [] | |
| def connect(): | |
| logger.info("[CONNECTED TO SERVER]") | |
| def disconnect(): | |
| logger.info("[DISCONNECTED FROM SERVER]") | |
| def chunk_retrieve(chunk): | |
| chunk_list.append(chunk) |