mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Use Any if JsonValue cannot be imported (#8336)
* Add fallback * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
0236b1ab12
commit
f138b4159e
5
.changeset/happy-cups-roll.md
Normal file
5
.changeset/happy-cups-roll.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Use Any if JsonValue cannot be imported
|
@ -16,7 +16,12 @@ from gradio_client.utils import traverse
|
||||
from . import wasm_utils
|
||||
|
||||
if not wasm_utils.IS_WASM or TYPE_CHECKING:
|
||||
from pydantic import BaseModel, JsonValue, RootModel, ValidationError
|
||||
from pydantic import BaseModel, RootModel, ValidationError
|
||||
|
||||
try:
|
||||
from pydantic import JsonValue
|
||||
except ImportError:
|
||||
JsonValue = Any
|
||||
else:
|
||||
# XXX: Currently Pyodide V2 is not available on Pyodide,
|
||||
# so we install V1 for the Wasm version.
|
||||
|
Loading…
Reference in New Issue
Block a user