Spaces:
Sleeping
Sleeping
| import random | |
| import requests | |
| import asyncio | |
| import os | |
| HUGGING_TOKEN = os.getenv("HF_TOKEN") | |
| async def hfv(api_url, timeout=10): | |
| try: | |
| headers = { | |
| "Authorization": f"Bearer {HUGGING_TOKEN}", | |
| "Content-Type": "application/json", | |
| } | |
| response = await async_searcher(api_url, headers=headers, re_json=True) | |
| stat = response.get("message", "ded") | |
| return stat | |
| except requests.exceptions.RequestException as e: | |
| print("Error occurred:", e) | |
| return False |