Home > Backend Development > Python Tutorial > Document API Update on Graddio

Document API Update on Graddio

Patricia Arquette
Release: 2024-10-28 15:27:02
Original
692 people have browsed it

Overview

  • Hey everyone! This last week, I had the chance to dive into the world of gradio and contribute to improving its documentation. It was a fun experience, so I thought I'd share what I learned and how it all went down.

    Document API Update on Graddio gradio-app / gradio

    Build and share delightful machine learning apps, all in Python. ? Star to support our work!

    Document API Update on Graddio
    Document API Update on Graddio Document API Update on Graddio

    Document API Update on Graddio Document API Update on Graddio Document API Update on Graddio Document API Update on Graddio Document API Update on Graddio Document API Update on Graddio

    Website | Documentation | Guides | Getting Started | Examples

    English | 中文

    Gradio: Build Machine Learning Web Apps — in Python

    Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then share a link to your demo or web application in just a few seconds using Gradio's built-in sharing features. No JavaScript, CSS, or web hosting experience needed!

    Document API Update on Graddio

    It just takes a few lines of Python to create your own demo, so let's get started ?

    Installation

    Prerequisite: Gradio 5 requires Python 3.10 or higher

    We recommend installing Gradio using pip, which is included by default in Python. Run this in your terminal or command prompt:

    pip install --upgrade gradio
    Copy after login
    Copy after login
    Enter fullscreen mode Exit fullscreen mode

    Tip

    It is best to install Gradio in a virtual environment. Detailed installation instructions for all…

    View on GitHub

Issue

Buttons of type 'huggingface' appear Black #9787

Document API Update on Graddio
Steveolas posted on

Describe the bug

When not in darkmode, 'huggingface buttons appear black with white text. When in darkmode they appear white. This is in contrary to the documentation. And in contrary to how they worked in gradio 5.1.0.

Have you searched existing issues? ?

  • [X] I have searched and found no existing issues

Reproduction

pip install --upgrade gradio
Copy after login
Copy after login
Enter fullscreen mode Exit fullscreen mode

Screenshot

Document API Update on Graddio

Logs

No response

System Info

import numpy as np
import gradio as gr

with gr.Blocks() as demo:
    text_button = gr.Button("I Am a Button", variant='huggingface')


if __name__ == "__main__":
    demo.launch()
Copy after login
Enter fullscreen mode Exit fullscreen mode

Severity

I can work around it

View on GitHub
  • It all started when a new issue popped up in the Gradio repository someone noticed that the 'huggingface' variant of the button component was showing up with a black background and white text when not in dark mode. This was different from how the documentation described it and even how it looked in Gradio 5.1.0. You can see the original issue

Pull Request

update docstring for the the "variant" parameter in `gr.Button` #9806

Document API Update on Graddio
fadingNA posted on

Description

Align parameter document of button api reference

? PRs Should Target Issues

Closes: #9787

Tests

All tests pass.

View on GitHub
  • Its turn out this PR is totally different from what I have done from first to last one, this one I just simply update API document to acting the correct behaviour of variant should be, but also good case to see how maintainer use the PR to make update about the API Document in the same time without create new PR seperately reduce flooding the PR for overlapping another un merge PR.

What I learned

  • Communication is Key - The conversation between the contributor and the maintainers was open and clear, which made it easy to understand what needed to be fixed. It’s a reminder of how valuable it is to reach out and ask questions.

The above is the detailed content of Document API Update on Graddio. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template