fast-api-cloud / app /services /http_client.py
Gowthamr23's picture
Upload folder using huggingface_hub
bab4aa8 verified
Raw
History Blame Contribute Delete
288 Bytes
import httpx
http_client: httpx.AsyncClient | None = None
async def init_http_client():
global http_client
http_client = httpx.AsyncClient()
async def close_http_client():
global http_client
if http_client:
await http_client.aclose()
http_client = None