Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to change page's tab title and icon #385

Closed
charlielito opened this issue Nov 23, 2021 · 8 comments
Closed

Way to change page's tab title and icon #385

charlielito opened this issue Nov 23, 2021 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@charlielito
Copy link
Contributor

charlielito commented Nov 23, 2021

Although you define the title for the interface, the page's tab doesn't show that title but instead it shows Gradio. Is there any way for changing this behavior? It is also possible to change the icon showed in the tab to be different?

unknown

@aliabid94
Copy link
Collaborator

Will implement and include in next release. I thought we already changed tab title to reflect the interface title but apparently not. Will also add favicon= kwarg.

@charlielito
Copy link
Contributor Author

charlielito commented Nov 23, 2021

Thanks for the fast reply @aliabid94 .
In the mean time do you know what's the proper way of installing gradio directly from the master branch? I tried pip install git+https://github.com/gradio-app/gradio.git but it doesn't work for other port different than 8000 which is very odd. If using another port I get the following traceback when opening the web page:

Running on local URL:  http://0.0.0.0:4569/

To create a public link, set `share=True` in `launch()`.
[2021-11-23 17:48:37,855] ERROR in app: Exception on /static/bundle.css [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/bundle.css'
[2021-11-23 17:48:37,856] ERROR in app: Exception on /static/css/main.ad1e2368.css [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/css/main.ad1e2368.css'
[2021-11-23 17:48:37,857] ERROR in app: Exception on /static/bundle.js [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/bundle.js'
[2021-11-23 17:48:37,867] ERROR in app: Exception on /static/bundle.css [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/bundle.css'
[2021-11-23 17:48:37,868] ERROR in app: Exception on /static/css/main.ad1e2368.css [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/css/main.ad1e2368.css'
[2021-11-23 17:48:37,868] ERROR in app: Exception on /static/bundle.js [GET]
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/networking.py", line 142, in static_resource
    return send_file(os.path.join(STATIC_PATH_LIB, path))
  File "/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/flask/helpers.py", line 629, in send_file
    file = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/gradio/lib/python3.7/site-packages/gradio/templates/frontend/static/bundle.js'

@abidlabs abidlabs added the enhancement New feature or request label Nov 27, 2021
@abidlabs
Copy link
Member

Hmm I wonder if this is due to the static files not being consistent with the pypi release. @aliabid94 can you comment here?

@abidlabs abidlabs added the good first issue Good for newcomers label Dec 9, 2021
@abidlabs
Copy link
Member

Favicon parameter (favicon_path) added to launch() as part of the latest changes in #440

In addition, the CONTRIBUTING.md guidelines have been improved for clarity

@abidlabs
Copy link
Member

Fixed in #440!

@yesdeepakmittal
Copy link
Contributor

Hi @abidlabs,

If we add title in the interface, the tab title is updated with it. Can we change the tab title without adding title in the interface?

Thanks

@abidlabs
Copy link
Member

abidlabs commented Apr 4, 2023

Hi @yesdeepakmittal yes it should be possible by wrapping the Interface within a gr.Blocks() and setting the title on the gr.Blocks. Something like this:

with gr.Blocks(title=title) as demo:
   gr.Interface(....)
demo.launch()

By the way, for general questions like this (that are not feature requests or bug reports), please ask in GitHub Discussions or our Discord.

@yesdeepakmittal
Copy link
Contributor

It's working thank you!

Will surely join Discord. Thanks for your kind information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants