Fixes the favicon_path working error (#8573)

* fixes  error

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Shruti Agarwal 2024-06-19 20:59:59 +05:30 committed by GitHub
parent ed82a6237e
commit 56af40f5e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:Fixes the `favicon_path` working error

View File

@ -7,6 +7,7 @@ import asyncio
import contextlib
import math
import sys
import warnings
if sys.version_info >= (3, 9):
from importlib.resources import files
@ -1287,6 +1288,12 @@ def mount_gradio_app(
app = gr.mount_gradio_app(app, io, path="/gradio")
# Then run `uvicorn run:app` from the terminal and navigate to http://localhost:8000/gradio.
"""
if favicon_path is not None and path != "/":
warnings.warn(
"The 'favicon_path' parameter is set but will be ignored because 'path' is not '/'. "
"Please add the favicon directly to your FastAPI app."
)
blocks.dev_mode = False
blocks.max_file_size = utils._parse_file_size(max_file_size)
blocks.config = blocks.get_config_file()