Almaatla commited on
Commit
749121c
·
verified ·
1 Parent(s): 14722c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- from huggingface_hub import configure_http_backend
 
10
 
11
  from schemas import *
12
  from classes import *
13
 
14
- def backend_factory() -> requests.Session:
15
- session = requests.Session()
16
- session.verify = False
17
- return session
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