mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
setting share=True on Spaces or in wasm should warn instead of raising error (#5696)
* setting share=True on Spaces or in wasm should raise warning instead of error * tweak * add changeset * lint * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
f70a394912
commit
e51fcd5d54
5
.changeset/young-glasses-juggle.md
Normal file
5
.changeset/young-glasses-juggle.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:setting share=True on Spaces or in wasm should warn instead of raising error
|
@ -2117,9 +2117,17 @@ Received outputs:
|
||||
|
||||
if self.share:
|
||||
if self.space_id:
|
||||
raise RuntimeError("Share is not supported when you are in Spaces")
|
||||
warnings.warn(
|
||||
"Setting share=True is not supported on Hugging Face Spaces"
|
||||
)
|
||||
self.share = False
|
||||
if wasm_utils.IS_WASM:
|
||||
raise RuntimeError("Share is not supported in the Wasm environment")
|
||||
warnings.warn(
|
||||
"Setting share=True is not supported in the Wasm environment"
|
||||
)
|
||||
self.share = False
|
||||
|
||||
if self.share:
|
||||
try:
|
||||
if self.share_url is None:
|
||||
self.share_url = networking.setup_tunnel(
|
||||
|
Loading…
x
Reference in New Issue
Block a user