Skip to content

Commit

Permalink
Merge branch 'main' into playground-auto-requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabd authored Oct 21, 2024
2 parents 720f864 + bcb7d15 commit ec8d5da
Show file tree
Hide file tree
Showing 227 changed files with 2,226 additions and 502 deletions.
6 changes: 6 additions & 0 deletions .changeset/chatty-pants-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"gradio": patch
"gradio_client": patch
---

fix:Update client.py: raise error on 429 get_config
5 changes: 0 additions & 5 deletions .changeset/empty-ears-search.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/few-weeks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/sanitize": patch
"gradio": patch
---

feat:fix `@gradio/sanitize` exports
5 changes: 5 additions & 0 deletions .changeset/happy-lies-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fixes #9742
5 changes: 5 additions & 0 deletions .changeset/honest-forks-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gradio/preview": patch
---

fix:Add a port timeout detection feature for gradio/preview.
11 changes: 11 additions & 0 deletions .changeset/lazy-lemons-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@gradio/atoms": minor
"@gradio/chatbot": minor
"@gradio/dataframe": minor
"@gradio/markdown": minor
"@gradio/markdown-code": minor
"@self/build": minor
"gradio": minor
---

feat:Fix website build issue
6 changes: 6 additions & 0 deletions .changeset/moody-feet-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/dataframe": patch
"gradio": patch
---

fix:Improve select event behaviour in gr.Dataframe
5 changes: 5 additions & 0 deletions .changeset/olive-lights-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fix API info bug
8 changes: 0 additions & 8 deletions .changeset/plenty-lizards-cheat.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/small-chicken-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gradio/tabs": patch
"gradio": patch
"website": patch
---

fix:Export `Tabs` type from `@gradio/tabs` and fix the Playground to be compatible with the new Tabs API
5 changes: 5 additions & 0 deletions .changeset/sweet-cloths-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Add a `.clear` event to the `gr.Chatbot` component
15 changes: 10 additions & 5 deletions .github/actions/install-all-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ runs:
run: |
python -m pip install --upgrade virtualenv
python -m virtualenv venv
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# - uses: actions/cache@v4
# id: cache
# with:
Expand All @@ -71,14 +76,14 @@ runs:
shell: bash
run: |
. ${{ env.VENV_ACTIVATE }}
python -m pip install -r test/requirements.txt
python -m pip install -r client/python/test/requirements.txt
uv pip install -r test/requirements.txt
uv pip install -r client/python/test/requirements.txt
- name: Install Gradio and Client Libraries Locally (Linux)
shell: bash
run: |
. ${{ env.VENV_ACTIVATE }}
python -m pip install -e client/python
python -m pip install -e ".[oauth]"
uv pip install -e client/python
uv pip install -e ".[oauth]"
- name: install-frontend
uses: "gradio-app/gradio/.github/actions/install-frontend-deps@main"
with:
Expand All @@ -89,4 +94,4 @@ runs:
if: inputs.os == 'ubuntu-latest'
run: |
. ${{ env.VENV_ACTIVATE }}
pip install boto3 && python js/_website/generate_jsons/generate.py
uv pip install boto3 && python js/_website/generate_jsons/generate.py
3 changes: 3 additions & 0 deletions .github/actions/install-frontend-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ runs:
- name: Build Css
shell: bash
run: pnpm css
- name: Create packages
shell: bash
run: pnpm package
- name: Build frontend
if: inputs.skip_build == 'false'
# && steps.frontend-cache.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Print Git Status
run: echo $(git status) && echo $(git diff)
- name: Assert Notebooks Match
run: git status | grep "nothing to commit, working tree clean"
run: git status --untracked-files=all demo/ | grep "nothing to commit, working tree clean"
- name: Check for large files
uses: actionsdesk/lfs-warning@4b98a8a5e6c429c23c34eee02d71553bca216425 # @v3.3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
uses: "gradio-app/gradio/.github/actions/install-frontend-deps@main"
with:
skip_build: true
- name: build client
run: pnpm --filter @gradio/client build
- name: build the wasm module
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# gradio

## 5.2.1

### Fixes

- [#9730](https://github.com/gradio-app/gradio/pull/9730) [`39a0e8c`](https://github.com/gradio-app/gradio/commit/39a0e8c2fb038eb0afc213fa6290c9b2acee7941) - Fix chatbot component streaming bug and visible bug. Thanks @freddyaboulton!

## 5.2.0

### Features

- [#9712](https://github.com/gradio-app/gradio/pull/9712) [`bad46f3`](https://github.com/gradio-app/gradio/commit/bad46f3e8c1b6e94ccb8c936fe6a0e1c1e6f87f8) - Set min FastAPI version. Thanks @freddyaboulton!
- [#9699](https://github.com/gradio-app/gradio/pull/9699) [`ea2367c`](https://github.com/gradio-app/gradio/commit/ea2367ccb1b75827a086d1c19e2a4595d7a5aa0f) - allow setting initial value of `gr.Dropdown` to `None` to designate that no value should be initially selected. Thanks @abidlabs!
- [#9681](https://github.com/gradio-app/gradio/pull/9681) [`2ed2361`](https://github.com/gradio-app/gradio/commit/2ed236187a9aab18e17fc4a8079eddef7dd195a5) - Allow setting title in gr.Info/Warning/Error. Thanks @ABucket!

### Fixes

- [#9716](https://github.com/gradio-app/gradio/pull/9716) [`3c7f2ad`](https://github.com/gradio-app/gradio/commit/3c7f2ad15f80724bbc5c88c24621e6a078d2bb97) - Restore light/dark custom setting. Thanks @aliabid94!
- [#9719](https://github.com/gradio-app/gradio/pull/9719) [`7ec57cb`](https://github.com/gradio-app/gradio/commit/7ec57cb018a97270cd00c6e1aa5558e378855c53) - Fix Lite dependencies. Thanks @whitphx!
- [#9711](https://github.com/gradio-app/gradio/pull/9711) [`7134fc2`](https://github.com/gradio-app/gradio/commit/7134fc272e9e60be4b80dfd294ff8926d5995188) - Custom component fixes. Thanks @freddyaboulton!
- [#9659](https://github.com/gradio-app/gradio/pull/9659) [`b1a0f6d`](https://github.com/gradio-app/gradio/commit/b1a0f6db0d6900cb4089f4d5809a5f1d5e2609ee) - Fix the behavior of `gr.LoginButton` locally and on Spaces. Thanks @abidlabs!
- [#9693](https://github.com/gradio-app/gradio/pull/9693) [`c45b466`](https://github.com/gradio-app/gradio/commit/c45b46652d49e0a8a5d8217bbbc6ddbe4b4e91f0) - Fix progress bar compatibility with generators. Thanks @brody715!
- [#9728](https://github.com/gradio-app/gradio/pull/9728) [`d0b2ce8`](https://github.com/gradio-app/gradio/commit/d0b2ce8c0f150f0b636ad7d2226f7c8c61401996) - Ensure tabs render in SSR mode and reduce time it takes for them to render. Thanks @pngwn!
- [#9709](https://github.com/gradio-app/gradio/pull/9709) [`31418ef`](https://github.com/gradio-app/gradio/commit/31418ef388a2dc524069ee230c2735a4beaf55f1) - fix table type check. Thanks @hannahblair!
- [#9731](https://github.com/gradio-app/gradio/pull/9731) [`ea283e7`](https://github.com/gradio-app/gradio/commit/ea283e739849dcbb1c49c04d4c756d3cb2d72dbb) - fix css syntax error. Thanks @pngwn!
- [#9652](https://github.com/gradio-app/gradio/pull/9652) [`35bebf3`](https://github.com/gradio-app/gradio/commit/35bebf38eb0f61fe8e4f032ee093e92355baeecb) - Hide default slider background. Thanks @hannahblair!
- [#9678](https://github.com/gradio-app/gradio/pull/9678) [`a25a26e`](https://github.com/gradio-app/gradio/commit/a25a26e208c3f3675ba857a889553c7ccc95e866) - Fix: `file_types` checking bug. Thanks @jasongzy!

## 5.1.0

### Features

- [#9662](https://github.com/gradio-app/gradio/pull/9662) [`b1c5a68`](https://github.com/gradio-app/gradio/commit/b1c5a68f9003b77b5c70b641100f7db339295180) - Tweak message shown in Colab notebooks. Thanks @abidlabs!
- [#9656](https://github.com/gradio-app/gradio/pull/9656) [`8f6626c`](https://github.com/gradio-app/gradio/commit/8f6626cd0e5a0c24e1966fbc3e28185c18a04b61) - Fix streaming Audio/Video Output. Thanks @freddyaboulton!
- [#9660](https://github.com/gradio-app/gradio/pull/9660) [`3407b50`](https://github.com/gradio-app/gradio/commit/3407b505c706cd8e2bbe03603a5ff825f2d0a08a) - Chat Interface Functional test Fix + Chat Examples Center. Thanks @dawoodkhan82!
- [#9677](https://github.com/gradio-app/gradio/pull/9677) [`3a19e69`](https://github.com/gradio-app/gradio/commit/3a19e690ef8de12c4494429d52988b863065eed3) - Revert text disable. Thanks @whitphx!

### Fixes

- [#9676](https://github.com/gradio-app/gradio/pull/9676) [`fd0264f`](https://github.com/gradio-app/gradio/commit/fd0264f3358ef848690eceacb75481212dceecf0) - Fix Audio in Chatbot bug. Thanks @freddyaboulton!

## 5.0.2

### Fixes

- [#9528](https://github.com/gradio-app/gradio/pull/9528) [`9004b11`](https://github.com/gradio-app/gradio/commit/9004b110640bdb54995343a870bf080ee15da02d) - Fix Lite to work on FireFox. Thanks @whitphx!

## 5.0.1

### Features
Expand Down
58 changes: 36 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,65 @@
![GitHub issues by-label](https://img.shields.io/github/issues/gradio-app/gradio/good%20first%20issue?color=fe7c01&link=https%3A%2F%2Fgithub.com%2Fgradio-app%2Fgradio%2Fissues%3Fq%3Dis%253Aopen%2Bis%253Aissue%2Blabel%253A%2522good%2Bfirst%2Bissue%2522)


More than 200 awesome developers have contributed to the `gradio` library, and we'd be thrilled if you would like to be the next contributor!
More than 300 awesome developers have contributed to the `gradio` library, and we'd be thrilled if you would like to be the next contributor!

Prerequisites:
**Prerequisites**:

- [Python 3.10+](https://www.python.org/downloads/)
- [Node.js v16.14+](https://nodejs.dev/en/download/package-manager/) (only needed if you are making changes to the frontend)
- [pnpm 8.1+](https://pnpm.io/8.x/installation) (only needed if you are making changes to the frontend)

## 🏡 Setup for local development

**Steps to Contribute**:

Generally speaking, contributing to Gradio involves four steps:

1. Identify a good issue to contribute to (such as any of the issues [tagged with "good first issue"]())
2. Setup Gradio locally
3. Understand the structure of the codebase & make the changes to the codebase locally
4. Open a pull request (PR) to upstream your changes to the Gradio repository

You can watch this short video walkthrough of how to contribute, or keep reading below:

<a href="https://www.youtube.com/watch?v=YTjwTe5Yurs&ab_channel=HuggingFace" target="_blank">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/gradio-guides/contributing-video-screenshot.png" style="width:100%">
</a>

## 🏡 Setup Gradio locally

There are a few ways to install and run Gradio.

### 🛠️ Install Gradio locally from `main`
### 🛠️ Install Gradio from `main`

- Clone this repo
- Navigate to the repo directory and (from the root directory) run
- Navigate to the repo directory and run:

```bash
bash scripts/install_gradio.sh
```

- Build the front end
- Run the frontend (only required if you are making changes to the frontend and would like to preview them)

```
bash scripts/build_frontend.sh
```bash
bash scripts/run_frontend.sh
```

- Install development requirements
- Install test requirements (only required if you want to run tests locally)

(Note that it is highly recommended to use a virtual environment running **Python 3.9** since the versions of Gradio's dependencies are pinned)
(Note that it is highly recommended to use a virtual environment running **Python 3.10** since the versions of Gradio's dependencies are pinned)

```
```bash
bash scripts/install_test_requirements.sh
```

If you have a different Python version and conflicting packages during the installation, please first run:

```
```bash
bash scripts/create_test_requirements.sh
```

### 📦 Using dev containers

You can alternatively use dev containers. This is supported on all platforms (macOS/Windows/Linux), as well as on GitHub Codespaces.
Instead of installing Gradio locally, you can alternatively use dev containers. This is supported on all platforms (macOS/Windows/Linux), as well as on GitHub Codespaces.

Prerequisites:

Expand All @@ -73,11 +88,10 @@ If you're a newcomer to Gradio, we recommend getting familiar with the overall s
- `/gradio/interface.py`: contains the Python source code for the core `Interface` class
- `/gradio/blocks.py`: contains the Python source code for the core `Blocks` class
- `/gradio/components/`: the directory that contains the Python source code for all of the Gradio components.
- `/js`: contains the HTML/JS/CSS source code for the library ([start here for frontend changes](/js/README.md))
- `/js/_website`: contains the code for the Gradio website (www.gradio.app). See the README in the `/js/_website` folder for more details
- `/test`: contains Python unit tests for the library
- `/demo`: contains demos that are used in the documentation, you can find `Gradio` examples over here.

- `/js`: contains the HTML/JS/CSS source code for the library, including the fronted code for each component in a separate directory
- `/js/_website`: contains the code for the Gradio website (www.gradio.app). See the README in the `/js/_website` folder for more details
- `/guides`: the written guides and tutorials that are found on Gradio's website.

## 🚀 Run a Gradio app

Expand All @@ -104,8 +118,8 @@ This will start the backend server in reload mode, which will watch for changes

If you're making frontend changes, start the frontend server:

```
pnpm dev
```bash
bash scripts/run_frontend.sh
```

This will open a separate browser tab. By default, Gradio will launch this on port 9876. Any changes to the frontend will also reload automatically in the browser. For more information about developing in the frontend, you can refer to [js/README.md](js/README.md).
Expand Down Expand Up @@ -273,15 +287,15 @@ and navigate to `http://localhost:8000` in your browser. The demo page `index.ht

## 📮 Submitting PRs

All PRs should be against `main`, and ideally should address an open issue, unless the change is small. Direct commits to main are blocked, and PRs require an approving review to merge into main. By convention, the Gradio maintainers will review PRs when:
All PRs should be submitted against `main`, and ideally should address an open issue, unless the change is small. Direct commits to main are blocked, and PRs require an approving review to merge into main. By convention, the Gradio maintainers will review PRs when:

- An initial review has been requested
- A clear, descriptive title has been assigned to the PR
- A maintainer (@abidlabs, @aliabid94, @aliabd, @AK391, @dawoodkhan82, @pngwn, @freddyaboulton, @hannahblair, @hysts, @whitphx) is tagged in the PR comments and asked to complete a review

🧹 We ask that you make sure initial CI checks are passing before requesting a review. One of the Gradio maintainers will merge the PR when all the checks are passing. You can safely ignore the Vercel and Spaces checks, which only run under maintainers' pull requests.

Don't forget the format your code before pushing:
Don't forget to format your code before pushing:

```
bash scripts/format_backend.sh
Expand Down
Loading

0 comments on commit ec8d5da

Please sign in to comment.