File size: 530 Bytes
6b1e8b6
 
 
04b72f3
6b1e8b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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