mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-11 11:19:58 +08:00
Use get_token instead of HfFolder.get_token (#10064)
* Use get_token instead of HfFolder.get_token * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
b400706fb6
commit
c38cf64df6
5
.changeset/itchy-facts-retire.md
Normal file
5
.changeset/itchy-facts-retire.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Use get_token instead of HfFolder.get_token
|
@ -10,7 +10,7 @@ from dataclasses import dataclass, field
|
||||
|
||||
import fastapi
|
||||
from fastapi.responses import RedirectResponse
|
||||
from huggingface_hub import HfFolder, whoami
|
||||
from huggingface_hub import get_token, whoami
|
||||
from starlette.datastructures import URL
|
||||
|
||||
from gradio.utils import get_space
|
||||
@ -298,7 +298,7 @@ class OAuthToken:
|
||||
|
||||
|
||||
def _get_mocked_oauth_info() -> typing.Dict:
|
||||
token = HfFolder.get_token()
|
||||
token = get_token()
|
||||
if token is None:
|
||||
raise ValueError(
|
||||
"Your machine must be logged in to HF to debug a Gradio app locally. Please"
|
||||
|
Loading…
Reference in New Issue
Block a user