Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,17 +6,17 @@ from fastapi.middleware.cors import CORSMiddleware
|
|
| 6 |
from fastapi.responses import FileResponse, StreamingResponse
|
| 7 |
from bs4 import BeautifulSoup
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
from schemas import *
|
| 12 |
from classes import *
|
| 13 |
|
| 14 |
-
def
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
|
| 19 |
-
configure_http_backend(backend_factory=backend_factory)
|
| 20 |
warnings.filterwarnings("ignore")
|
| 21 |
load_dotenv()
|
| 22 |
|
|
|
|
| 6 |
from fastapi.responses import FileResponse, StreamingResponse
|
| 7 |
from bs4 import BeautifulSoup
|
| 8 |
|
| 9 |
+
import httpx
|
| 10 |
+
from huggingface_hub.utils import set_client_factory
|
| 11 |
|
| 12 |
from schemas import *
|
| 13 |
from classes import *
|
| 14 |
|
| 15 |
+
def hf_client_factory() -> httpx.Client:
|
| 16 |
+
return httpx.Client(verify=False)
|
| 17 |
+
|
| 18 |
+
set_client_factory(hf_client_factory)
|
| 19 |
|
|
|
|
| 20 |
warnings.filterwarnings("ignore")
|
| 21 |
load_dotenv()
|
| 22 |
|