diff --git a/.changeset/chilly-socks-poke.md b/.changeset/chilly-socks-poke.md new file mode 100644 index 0000000000000..85f9336838641 --- /dev/null +++ b/.changeset/chilly-socks-poke.md @@ -0,0 +1,7 @@ +--- +"@gradio/code": minor +"@gradio/icons": minor +"gradio": minor +--- + +feat:Improve `gr.Code` diff --git a/.changeset/dark-rings-lie.md b/.changeset/dark-rings-lie.md new file mode 100644 index 0000000000000..afd8ea5d02b5b --- /dev/null +++ b/.changeset/dark-rings-lie.md @@ -0,0 +1,5 @@ +--- +"gradio": minor +--- + +feat:test semgrep ci diff --git a/.changeset/dirty-lions-follow.md b/.changeset/dirty-lions-follow.md new file mode 100644 index 0000000000000..e1d472603a3d1 --- /dev/null +++ b/.changeset/dirty-lions-follow.md @@ -0,0 +1,5 @@ +--- +"website": minor +--- + +feat:Expanding AI Playground Prompt for Qwen diff --git a/.changeset/metal-nights-march.md b/.changeset/metal-nights-march.md deleted file mode 100644 index f0dfd1de44af9..0000000000000 --- a/.changeset/metal-nights-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"gradio": minor ---- - -feat:chore: fix docs style diff --git a/.changeset/mighty-goats-dance.md b/.changeset/mighty-goats-dance.md new file mode 100644 index 0000000000000..5837c7bb9349a --- /dev/null +++ b/.changeset/mighty-goats-dance.md @@ -0,0 +1,6 @@ +--- +"@gradio/code": minor +"gradio": minor +--- + +feat:Add Jinja2 language to Code component diff --git a/.changeset/pre.json b/.changeset/pre.json index 42f847469ce00..e5882d37ef6cf 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -84,6 +84,7 @@ "beige-houses-shine", "breezy-olives-wonder", "bright-apes-fly", + "brown-queens-begin", "busy-jokes-sit", "busy-tools-chew", "calm-jobs-hope", @@ -91,7 +92,9 @@ "calm-planets-send", "chatty-houses-do", "chilly-places-sniff", + "chilly-socks-poke", "chubby-hairs-beam", + "clean-pigs-arrive", "cold-lies-mate", "cruel-heads-hunt", "cuddly-queens-melt", @@ -102,6 +105,7 @@ "deep-bananas-switch", "deep-memes-cheat", "deep-ways-wink", + "dirty-lions-follow", "dirty-pugs-hunt", "dry-frogs-argue", "dull-plants-trade", @@ -117,17 +121,19 @@ "gold-bats-return", "green-pigs-wonder", "green-wasps-invent", + "heavy-goats-grab", "honest-plums-peel", "huge-corners-tease", "hungry-dragons-drum", "hungry-tips-sin", "khaki-ducks-stare", + "khaki-ways-agree", "legal-masks-pay", "light-bats-arrive", "long-donkeys-hang", "lovely-ties-live", "lucky-hotels-sort", - "metal-nights-march", + "many-moons-like", "modern-baboons-swim", "nasty-moments-mix", "nasty-zebras-cheat", @@ -142,7 +148,6 @@ "pretty-hairs-rest", "proud-memes-fold", "public-baboons-dig", - "public-webs-melt", "puny-bats-smell", "red-brooms-bow", "rich-crews-suffer", @@ -154,6 +159,7 @@ "seven-deer-occur", "sharp-bikes-sleep", "shy-foxes-flow", + "silent-moose-push", "silly-chefs-marry", "six-bobcats-cry", "social-lizards-tickle", @@ -168,20 +174,25 @@ "tame-zoos-care", "thick-geese-divide", "thick-wasps-love", + "thin-boxes-matter", + "thirty-cloths-taste", "three-toys-knock", "tidy-bobcats-marry", "tired-moons-tell", "tough-rooms-flash", "true-pigs-build", + "two-geckos-accept", "warm-lemons-mate", "weak-glasses-enter", "wet-memes-smash", + "wicked-snails-drum", "wicked-swans-wink", "wide-dodos-peel", "witty-rice-fix", "witty-worlds-grin", "young-candles-stare", "young-ears-vanish", + "young-memes-shake", "yummy-weeks-learn" ] } diff --git a/.changeset/public-webs-melt.md b/.changeset/public-webs-melt.md deleted file mode 100644 index b300262cf7992..0000000000000 --- a/.changeset/public-webs-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"website": minor ---- - -feat:Testing CI diff --git a/.changeset/smooth-places-walk.md b/.changeset/smooth-places-walk.md new file mode 100644 index 0000000000000..f6066cfa90a7e --- /dev/null +++ b/.changeset/smooth-places-walk.md @@ -0,0 +1,6 @@ +--- +"@gradio/dropdown": minor +"gradio": minor +--- + +feat:Fix single select dropdown diff --git a/.changeset/stupid-memes-turn.md b/.changeset/stupid-memes-turn.md new file mode 100644 index 0000000000000..454d81d7a5ddb --- /dev/null +++ b/.changeset/stupid-memes-turn.md @@ -0,0 +1,6 @@ +--- +"@gradio/nativeplot": minor +"gradio": minor +--- + +feat:Hide x axis labels diff --git a/.changeset/tall-impalas-reply.md b/.changeset/tall-impalas-reply.md new file mode 100644 index 0000000000000..1347dc1ad5506 --- /dev/null +++ b/.changeset/tall-impalas-reply.md @@ -0,0 +1,5 @@ +--- +"website": minor +--- + +feat:Use latest lite wheel on website diff --git a/.changeset/thin-boxes-matter.md b/.changeset/thin-boxes-matter.md new file mode 100644 index 0000000000000..fbd518932a621 --- /dev/null +++ b/.changeset/thin-boxes-matter.md @@ -0,0 +1,5 @@ +--- +"gradio": minor +--- + +feat:Fix node process to run with correct server name diff --git a/.changeset/wicked-snails-drum.md b/.changeset/wicked-snails-drum.md new file mode 100644 index 0000000000000..5837379d271c9 --- /dev/null +++ b/.changeset/wicked-snails-drum.md @@ -0,0 +1,7 @@ +--- +"@gradio/dropdown": minor +"@gradio/radio": minor +"gradio": minor +--- + +feat:Fix change triggers for dropdown and radio diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml new file mode 100644 index 0000000000000..69cd6e0d90168 --- /dev/null +++ b/.github/workflows/semgrep.yml @@ -0,0 +1,62 @@ +name: semgrep ci + +on: + workflow_run: + workflows: ["trigger-semgrep"] + types: + - completed + +env: + CI: true + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" + +concurrency: + group: "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}" + cancel-in-progress: true + +permissions: {} + +jobs: + semgrep: + permissions: + contents: read + name: semgrep/ci + runs-on: ubuntu-latest + container: + image: semgrep/semgrep + outputs: + pr_number: ${{ steps.json.outputs.pr_number }} + sha: ${{ steps.json.outputs.sha }} + if: (github.actor != 'dependabot[bot]') + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: changes + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + - uses: gradio-app/github/actions/json-to-output@main + id: json + with: + path: output.json + - uses: actions/checkout@v4 + with: + repository: ${{ steps.json.outputs.source_repo }} + ref: ${{ steps.json.outputs.sha }} + - run: semgrep ci --config .github/workflows/semgrep_rules.yaml + update-status: + permissions: + actions: read + statuses: write + runs-on: ubuntu-latest + needs: semgrep + steps: + - name: update status + uses: gradio-app/github/actions/commit-status@main + with: + sha: ${{ needs.semgrep.outputs.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + name: "Semgrep Results" + pr: ${{ needs.semgrep.outputs.pr_number }} + result: ${{ needs.semgrep.result == 'success' && 'success' || 'failure' }} + type: all diff --git a/.github/workflows/semgrep_rules.yaml b/.github/workflows/semgrep_rules.yaml new file mode 100644 index 0000000000000..4eab4c635136b --- /dev/null +++ b/.github/workflows/semgrep_rules.yaml @@ -0,0 +1,18 @@ +rules: + - id: detect-os-system-calls + pattern: os.system(...) + message: "Unsafe use of os.system(). Consider using subprocess.run() instead." + languages: [python] + severity: WARNING + + - id: detect-sql-injection + pattern: 'execute("SELECT * FROM " + $TABLE)' + message: "Potential SQL injection detected. Use parameterized queries." + languages: [python] + severity: ERROR + + - id: detect-eval-usage + pattern: eval(...) + message: "Use of eval() detected. This can be dangerous if used with untrusted input." + languages: [python] + severity: ERROR diff --git a/.github/workflows/trigger-semgrep.yml b/.github/workflows/trigger-semgrep.yml new file mode 100644 index 0000000000000..41fdff97f91a4 --- /dev/null +++ b/.github/workflows/trigger-semgrep.yml @@ -0,0 +1,29 @@ +name: trigger-semgrep +on: + pull_request: + branches: + - main + - 5.0-dev + +permissions: {} + +jobs: + changes: + permissions: + contents: read + pull-requests: read + name: "changes" + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.changes.outputs.should_run }} + sha: ${{ steps.changes.outputs.sha }} + pr_number: ${{ steps.changes.outputs.pr_number }} + source_branch: ${{ steps.changes.outputs.source_branch }} + source_repo: ${{ steps.changes.outputs.source_repo }} + steps: + - uses: actions/checkout@v4 + - uses: "gradio-app/gradio/.github/actions/changes@main" + id: changes + with: + filter: "gradio" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/website-deploy.yml b/.github/workflows/website-deploy.yml index 4bbe0b1af97d9..0a9d5bb1da960 100644 --- a/.github/workflows/website-deploy.yml +++ b/.github/workflows/website-deploy.yml @@ -52,10 +52,7 @@ jobs: permissions: actions: read outputs: - vercel_url: ${{ steps.output_url.outputs.vercel_url }} - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + cloudflare_url: ${{ steps.cloudflare-preview.outputs.deployment-url }} steps: - name: download website artifacts uses: actions/download-artifact@v4 @@ -67,17 +64,6 @@ jobs: - name: list files run: ls -R . - - name: Pull Vercel Environment Information - shell: bash - if: needs.changes.outputs.pr_number != 'false' - run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website - - - name: Deploy Project Artifacts to Vercel - if: needs.changes.outputs.pr_number != 'false' - id: output_url - shell: bash - run: echo "vercel_url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website)" >> $GITHUB_OUTPUT - - name: Deploy Preview Website to Cloudflare Pages if: needs.changes.outputs.pr_number != 'false' id: cloudflare-preview @@ -88,16 +74,6 @@ jobs: command: pages deploy js/_website/.vercel/output/static --project-name=gradio-website --branch=${{ needs.changes.outputs.source_branch }} # production - - name: Pull Vercel Environment Information - if: needs.changes.outputs.source_repo == 'gradio-app/gradio' && needs.changes.outputs.source_branch == 'refs/heads/main' - shell: bash - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website - - - name: Deploy Project Artifacts to Vercel - if: needs.changes.outputs.source_repo == 'gradio-app/gradio' && needs.changes.outputs.source_branch == 'refs/heads/main' - shell: bash - run: echo "VERCEL_URL=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website)" >> $GITHUB_ENV - - name: Deploy Production Website to Cloudflare Pages if: needs.changes.outputs.source_repo == 'gradio-app/gradio' && needs.changes.outputs.source_branch == 'refs/heads/main' id: cloudflare-production @@ -115,7 +91,7 @@ jobs: gh_token: ${{ secrets.COMMENT_TOKEN }} with: pr_number: ${{ needs.changes.outputs.pr_number }} - message: website~success~${{needs.deploy.outputs.vercel_url}} + message: website~success~${{needs.deploy.outputs.cloudflare_url}} comment-deploy-failure: uses: "./.github/workflows/comment-queue.yml" needs: [deploy, changes] diff --git a/CHANGELOG.md b/CHANGELOG.md index 681483425e19d..ec0a79687fdc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # gradio +## 5.0.0-beta.6 + +### Features + +- [#9460](https://github.com/gradio-app/gradio/pull/9460) [`7352a89`](https://github.com/gradio-app/gradio/commit/7352a89722da91461c32fd33588531f3edce9c48) - Playground requirements tab. Thanks @whitphx! +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! +- [#9450](https://github.com/gradio-app/gradio/pull/9450) [`991883e`](https://github.com/gradio-app/gradio/commit/991883e217dc0a3512b3ae3245378812f373b8db) - Improve `gr.Code`. Thanks @hannahblair! +- [#9504](https://github.com/gradio-app/gradio/pull/9504) [`d054262`](https://github.com/gradio-app/gradio/commit/d054262f611d5f1eb1a1c936db7152347a891f8e) - Centre components within `Block` when height and width are set. Thanks @hannahblair! +- [#9481](https://github.com/gradio-app/gradio/pull/9481) [`2510a6e`](https://github.com/gradio-app/gradio/commit/2510a6e978a49432d7820e9518f164a70cf8acc8) - Fix `slider-color` var. Thanks @hannahblair! +- [#9495](https://github.com/gradio-app/gradio/pull/9495) [`488ef76`](https://github.com/gradio-app/gradio/commit/488ef768ccc5008401f7e0aa4c357b93311190ff) - Fix custom component CLI unit tests. Thanks @freddyaboulton! +- [#9488](https://github.com/gradio-app/gradio/pull/9488) [`4e6a47f`](https://github.com/gradio-app/gradio/commit/4e6a47f5a29cb885d5bc01a79ca4cc45d298f0b1) - Fixes: Chatbot examples for custom chatbot + rename `suggestions` -> `examples`. Thanks @dawoodkhan82! +- [#9506](https://github.com/gradio-app/gradio/pull/9506) [`861f5e9`](https://github.com/gradio-app/gradio/commit/861f5e97ffde5f59e42cfa213364f19e84d799fd) - Fix node process to run with correct server name. Thanks @abidlabs! +- [#9493](https://github.com/gradio-app/gradio/pull/9493) [`c307a0c`](https://github.com/gradio-app/gradio/commit/c307a0c9b81b66bde21f0af4a9f7d5726ea7a30d) - Minor fixes to docs and a demo. Thanks @abidlabs! +- [#9519](https://github.com/gradio-app/gradio/pull/9519) [`0ab6ac5`](https://github.com/gradio-app/gradio/commit/0ab6ac5dc01b69e4f2462d00c4910f3354441227) - Fix change triggers for dropdown and radio. Thanks @dawoodkhan82! + +### Fixes + +- [#9431](https://github.com/gradio-app/gradio/pull/9431) [`7065e11`](https://github.com/gradio-app/gradio/commit/7065e11e465fcdfe14688bd6ca2aeed0a25fcc36) - Check for `file_types` parameter in the backend. Thanks @dawoodkhan82! + ## 5.0.0-beta.5 ### Features @@ -135,6 +154,12 @@ - [#9189](https://github.com/gradio-app/gradio/pull/9189) [`ab142ee`](https://github.com/gradio-app/gradio/commit/ab142ee13d19070b75b5eb03efcda7193b8993c2) - Fix serialization error in curl api. Thanks @freddyaboulton! +## 4.44.1 + +### Features + +- [#9320](https://github.com/gradio-app/gradio/pull/9320) [`98cbcae`](https://github.com/gradio-app/gradio/commit/98cbcaef827de7267462ccba180c7b2ffb1e825d) - chore: fix docs style. Thanks @imba-tjd! + ## 4.44.0 ### Features diff --git a/client/python/CHANGELOG.md b/client/python/CHANGELOG.md index 16b8d06ebb881..37e2c25237940 100644 --- a/client/python/CHANGELOG.md +++ b/client/python/CHANGELOG.md @@ -1,5 +1,11 @@ # gradio_client +## 1.4.0-beta.3 + +### Fixes + +- [#9431](https://github.com/gradio-app/gradio/pull/9431) [`7065e11`](https://github.com/gradio-app/gradio/commit/7065e11e465fcdfe14688bd6ca2aeed0a25fcc36) - Check for `file_types` parameter in the backend. Thanks @dawoodkhan82! + ## 1.4.0-beta.2 ### Features diff --git a/client/python/gradio_client/CHANGELOG.md b/client/python/gradio_client/CHANGELOG.md index 16b8d06ebb881..37e2c25237940 100644 --- a/client/python/gradio_client/CHANGELOG.md +++ b/client/python/gradio_client/CHANGELOG.md @@ -1,5 +1,11 @@ # gradio_client +## 1.4.0-beta.3 + +### Fixes + +- [#9431](https://github.com/gradio-app/gradio/pull/9431) [`7065e11`](https://github.com/gradio-app/gradio/commit/7065e11e465fcdfe14688bd6ca2aeed0a25fcc36) - Check for `file_types` parameter in the backend. Thanks @dawoodkhan82! + ## 1.4.0-beta.2 ### Features diff --git a/client/python/gradio_client/package.json b/client/python/gradio_client/package.json index 05b99d9a9719f..b452ccebc94a4 100644 --- a/client/python/gradio_client/package.json +++ b/client/python/gradio_client/package.json @@ -1,6 +1,6 @@ { "name": "gradio_client", - "version": "1.4.0-beta.2", + "version": "1.4.0-beta.3", "description": "", "python": "true", "main_changeset": true, diff --git a/demo/outbreak_forecast/requirements.txt b/demo/outbreak_forecast/requirements.txt index 7a0aa970fdc8f..f513b41b84d2c 100644 --- a/demo/outbreak_forecast/requirements.txt +++ b/demo/outbreak_forecast/requirements.txt @@ -3,4 +3,3 @@ matplotlib bokeh plotly altair -opencv-python \ No newline at end of file diff --git a/demo/outbreak_forecast/run.ipynb b/demo/outbreak_forecast/run.ipynb index 1cfc4b9beaeae..48151f13b9897 100644 --- a/demo/outbreak_forecast/run.ipynb +++ b/demo/outbreak_forecast/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: outbreak_forecast\n", "### Generate a plot based on 5 inputs.\n", " "]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio numpy matplotlib bokeh plotly altair opencv-python"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import altair\n", "\n", "import gradio as gr\n", "from math import sqrt\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import plotly.express as px\n", "import pandas as pd\n", "\n", "def outbreak(plot_type, r, month, countries, social_distancing):\n", " months = [\"January\", \"February\", \"March\", \"April\", \"May\"]\n", " m = months.index(month)\n", " start_day = 30 * m\n", " final_day = 30 * (m + 1)\n", " x = np.arange(start_day, final_day + 1)\n", " pop_count = {\"USA\": 350, \"Canada\": 40, \"Mexico\": 300, \"UK\": 120}\n", " if social_distancing:\n", " r = sqrt(r)\n", " df = pd.DataFrame({\"day\": x})\n", " for country in countries:\n", " df[country] = x ** (r) * (pop_count[country] + 1)\n", "\n", " if plot_type == \"Matplotlib\":\n", " fig = plt.figure()\n", " plt.plot(df[\"day\"], df[countries].to_numpy())\n", " plt.title(\"Outbreak in \" + month)\n", " plt.ylabel(\"Cases\")\n", " plt.xlabel(\"Days since Day 0\")\n", " plt.legend(countries)\n", " return fig\n", " elif plot_type == \"Plotly\":\n", " fig = px.line(df, x=\"day\", y=countries)\n", " fig.update_layout(\n", " title=\"Outbreak in \" + month,\n", " xaxis_title=\"Cases\",\n", " yaxis_title=\"Days Since Day 0\",\n", " )\n", " return fig\n", " elif plot_type == \"Altair\":\n", " df = df.melt(id_vars=\"day\").rename(columns={\"variable\": \"country\"})\n", " fig = altair.Chart(df).mark_line().encode(x=\"day\", y=\"value\", color=\"country\")\n", " return fig\n", " else:\n", " raise ValueError(\"A plot type must be selected\")\n", "\n", "inputs = [\n", " gr.Dropdown([\"Matplotlib\", \"Plotly\", \"Altair\"], label=\"Plot Type\"),\n", " gr.Slider(1, 4, 3.2, label=\"R\"),\n", " gr.Dropdown([\"January\", \"February\", \"March\", \"April\", \"May\"], label=\"Month\"),\n", " gr.CheckboxGroup(\n", " [\"USA\", \"Canada\", \"Mexico\", \"UK\"], label=\"Countries\", value=[\"USA\", \"Canada\"]\n", " ),\n", " gr.Checkbox(label=\"Social Distancing?\"),\n", "]\n", "outputs = gr.Plot()\n", "\n", "demo = gr.Interface(\n", " fn=outbreak,\n", " inputs=inputs,\n", " outputs=outputs,\n", " examples=[\n", " [\"Matplotlib\", 2, \"March\", [\"Mexico\", \"UK\"], True],\n", " [\"Altair\", 2, \"March\", [\"Mexico\", \"Canada\"], True],\n", " [\"Plotly\", 3.6, \"February\", [\"Canada\", \"Mexico\", \"UK\"], False],\n", " ],\n", " cache_examples=True,\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: outbreak_forecast\n", "### Generate a plot based on 5 inputs.\n", " "]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio numpy matplotlib bokeh plotly altair "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from math import sqrt\n", "import numpy as np\n", "import pandas as pd\n", "\n", "def outbreak(plot_type, r, month, countries, social_distancing):\n", " months = [\"January\", \"February\", \"March\", \"April\", \"May\"]\n", " m = months.index(month)\n", " start_day = 30 * m\n", " final_day = 30 * (m + 1)\n", " x = np.arange(start_day, final_day + 1)\n", " pop_count = {\"USA\": 350, \"Canada\": 40, \"Mexico\": 300, \"UK\": 120}\n", " if social_distancing:\n", " r = sqrt(r)\n", " df = pd.DataFrame({\"day\": x})\n", " for country in countries:\n", " df[country] = x ** (r) * (pop_count[country] + 1)\n", "\n", " if plot_type == \"Matplotlib\":\n", " import matplotlib.pyplot as plt\n", "\n", " fig = plt.figure()\n", " plt.plot(df[\"day\"], df[countries].to_numpy())\n", " plt.title(\"Outbreak in \" + month)\n", " plt.ylabel(\"Cases\")\n", " plt.xlabel(\"Days since Day 0\")\n", " plt.legend(countries)\n", " return fig\n", " elif plot_type == \"Plotly\":\n", " import plotly.express as px\n", "\n", " fig = px.line(df, x=\"day\", y=countries)\n", " fig.update_layout(\n", " title=\"Outbreak in \" + month,\n", " xaxis_title=\"Cases\",\n", " yaxis_title=\"Days Since Day 0\",\n", " )\n", " return fig\n", " elif plot_type == \"Altair\":\n", " import altair\n", "\n", " df = df.melt(id_vars=\"day\").rename(columns={\"variable\": \"country\"})\n", " fig = altair.Chart(df).mark_line().encode(x=\"day\", y=\"value\", color=\"country\")\n", " return fig\n", " elif plot_type == \"Bokeh\":\n", " from bokeh.plotting import figure\n", " from bokeh.models import ColumnDataSource\n", "\n", " source = ColumnDataSource(df)\n", " fig = figure(title=\"Outbreak in \" + month, x_axis_label=\"Days since Day 0\", y_axis_label=\"Cases\")\n", " for country in countries:\n", " fig.line(\"day\", country, source=source, legend_label=country)\n", " return fig\n", " else:\n", " raise ValueError(\"A plot type must be selected\")\n", "\n", "inputs = [\n", " gr.Dropdown([\"Matplotlib\", \"Plotly\", \"Altair\", \"Bokeh\"], label=\"Plot Type\", value=\"Matplotlib\"),\n", " gr.Slider(1, 4, 3.2, label=\"R\"),\n", " gr.Dropdown([\"January\", \"February\", \"March\", \"April\", \"May\"], label=\"Month\", value=\"March\"),\n", " gr.CheckboxGroup(\n", " [\"USA\", \"Canada\", \"Mexico\", \"UK\"], label=\"Countries\", value=[\"USA\", \"Canada\"]\n", " ),\n", " gr.Checkbox(label=\"Social Distancing?\"),\n", "]\n", "outputs = gr.Plot()\n", "\n", "demo = gr.Interface(\n", " fn=outbreak,\n", " inputs=inputs,\n", " outputs=outputs,\n", " examples=[\n", " [\"Matplotlib\", 2, \"March\", [\"Mexico\", \"UK\"], True],\n", " [\"Altair\", 2, \"March\", [\"Mexico\", \"Canada\"], True],\n", " [\"Plotly\", 3.6, \"February\", [\"Canada\", \"Mexico\", \"UK\"], False],\n", " [\"Bokeh\", 3.2, \"April\", [\"Canada\", \"UK\"], False],\n", " ],\n", " cache_examples=True,\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/outbreak_forecast/run.py b/demo/outbreak_forecast/run.py index 1802e5766a6ef..797479db7999f 100644 --- a/demo/outbreak_forecast/run.py +++ b/demo/outbreak_forecast/run.py @@ -1,10 +1,6 @@ -import altair - import gradio as gr from math import sqrt -import matplotlib.pyplot as plt import numpy as np -import plotly.express as px import pandas as pd def outbreak(plot_type, r, month, countries, social_distancing): @@ -21,6 +17,8 @@ def outbreak(plot_type, r, month, countries, social_distancing): df[country] = x ** (r) * (pop_count[country] + 1) if plot_type == "Matplotlib": + import matplotlib.pyplot as plt + fig = plt.figure() plt.plot(df["day"], df[countries].to_numpy()) plt.title("Outbreak in " + month) @@ -29,6 +27,8 @@ def outbreak(plot_type, r, month, countries, social_distancing): plt.legend(countries) return fig elif plot_type == "Plotly": + import plotly.express as px + fig = px.line(df, x="day", y=countries) fig.update_layout( title="Outbreak in " + month, @@ -37,16 +37,27 @@ def outbreak(plot_type, r, month, countries, social_distancing): ) return fig elif plot_type == "Altair": + import altair + df = df.melt(id_vars="day").rename(columns={"variable": "country"}) fig = altair.Chart(df).mark_line().encode(x="day", y="value", color="country") return fig + elif plot_type == "Bokeh": + from bokeh.plotting import figure + from bokeh.models import ColumnDataSource + + source = ColumnDataSource(df) + fig = figure(title="Outbreak in " + month, x_axis_label="Days since Day 0", y_axis_label="Cases") + for country in countries: + fig.line("day", country, source=source, legend_label=country) + return fig else: raise ValueError("A plot type must be selected") inputs = [ - gr.Dropdown(["Matplotlib", "Plotly", "Altair"], label="Plot Type"), + gr.Dropdown(["Matplotlib", "Plotly", "Altair", "Bokeh"], label="Plot Type", value="Matplotlib"), gr.Slider(1, 4, 3.2, label="R"), - gr.Dropdown(["January", "February", "March", "April", "May"], label="Month"), + gr.Dropdown(["January", "February", "March", "April", "May"], label="Month", value="March"), gr.CheckboxGroup( ["USA", "Canada", "Mexico", "UK"], label="Countries", value=["USA", "Canada"] ), @@ -62,6 +73,7 @@ def outbreak(plot_type, r, month, countries, social_distancing): ["Matplotlib", 2, "March", ["Mexico", "UK"], True], ["Altair", 2, "March", ["Mexico", "Canada"], True], ["Plotly", 3.6, "February", ["Canada", "Mexico", "UK"], False], + ["Bokeh", 3.2, "April", ["Canada", "UK"], False], ], cache_examples=True, ) diff --git a/gradio/CHANGELOG.md b/gradio/CHANGELOG.md index 681483425e19d..ec0a79687fdc5 100644 --- a/gradio/CHANGELOG.md +++ b/gradio/CHANGELOG.md @@ -1,5 +1,24 @@ # gradio +## 5.0.0-beta.6 + +### Features + +- [#9460](https://github.com/gradio-app/gradio/pull/9460) [`7352a89`](https://github.com/gradio-app/gradio/commit/7352a89722da91461c32fd33588531f3edce9c48) - Playground requirements tab. Thanks @whitphx! +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! +- [#9450](https://github.com/gradio-app/gradio/pull/9450) [`991883e`](https://github.com/gradio-app/gradio/commit/991883e217dc0a3512b3ae3245378812f373b8db) - Improve `gr.Code`. Thanks @hannahblair! +- [#9504](https://github.com/gradio-app/gradio/pull/9504) [`d054262`](https://github.com/gradio-app/gradio/commit/d054262f611d5f1eb1a1c936db7152347a891f8e) - Centre components within `Block` when height and width are set. Thanks @hannahblair! +- [#9481](https://github.com/gradio-app/gradio/pull/9481) [`2510a6e`](https://github.com/gradio-app/gradio/commit/2510a6e978a49432d7820e9518f164a70cf8acc8) - Fix `slider-color` var. Thanks @hannahblair! +- [#9495](https://github.com/gradio-app/gradio/pull/9495) [`488ef76`](https://github.com/gradio-app/gradio/commit/488ef768ccc5008401f7e0aa4c357b93311190ff) - Fix custom component CLI unit tests. Thanks @freddyaboulton! +- [#9488](https://github.com/gradio-app/gradio/pull/9488) [`4e6a47f`](https://github.com/gradio-app/gradio/commit/4e6a47f5a29cb885d5bc01a79ca4cc45d298f0b1) - Fixes: Chatbot examples for custom chatbot + rename `suggestions` -> `examples`. Thanks @dawoodkhan82! +- [#9506](https://github.com/gradio-app/gradio/pull/9506) [`861f5e9`](https://github.com/gradio-app/gradio/commit/861f5e97ffde5f59e42cfa213364f19e84d799fd) - Fix node process to run with correct server name. Thanks @abidlabs! +- [#9493](https://github.com/gradio-app/gradio/pull/9493) [`c307a0c`](https://github.com/gradio-app/gradio/commit/c307a0c9b81b66bde21f0af4a9f7d5726ea7a30d) - Minor fixes to docs and a demo. Thanks @abidlabs! +- [#9519](https://github.com/gradio-app/gradio/pull/9519) [`0ab6ac5`](https://github.com/gradio-app/gradio/commit/0ab6ac5dc01b69e4f2462d00c4910f3354441227) - Fix change triggers for dropdown and radio. Thanks @dawoodkhan82! + +### Fixes + +- [#9431](https://github.com/gradio-app/gradio/pull/9431) [`7065e11`](https://github.com/gradio-app/gradio/commit/7065e11e465fcdfe14688bd6ca2aeed0a25fcc36) - Check for `file_types` parameter in the backend. Thanks @dawoodkhan82! + ## 5.0.0-beta.5 ### Features @@ -135,6 +154,12 @@ - [#9189](https://github.com/gradio-app/gradio/pull/9189) [`ab142ee`](https://github.com/gradio-app/gradio/commit/ab142ee13d19070b75b5eb03efcda7193b8993c2) - Fix serialization error in curl api. Thanks @freddyaboulton! +## 4.44.1 + +### Features + +- [#9320](https://github.com/gradio-app/gradio/pull/9320) [`98cbcae`](https://github.com/gradio-app/gradio/commit/98cbcaef827de7267462ccba180c7b2ffb1e825d) - chore: fix docs style. Thanks @imba-tjd! + ## 4.44.0 ### Features diff --git a/gradio/blocks.py b/gradio/blocks.py index 50f575140fc72..ff7cf2e968f21 100644 --- a/gradio/blocks.py +++ b/gradio/blocks.py @@ -2429,15 +2429,16 @@ def reverse(text): self.node_path = os.environ.get( "GRADIO_NODE_PATH", "" if wasm_utils.IS_WASM else get_node_path() ) - self.node_server_name = node_server_name - self.node_port = node_port - - self.node_server_name, self.node_process, self.node_port = start_node_server( - server_name=self.node_server_name, - server_port=self.node_port, - node_path=self.node_path, - ssr_mode=self.ssr_mode, - ) + if self.ssr_mode: + self.node_server_name, self.node_process, self.node_port = ( + start_node_server( + server_name=node_server_name, + server_port=node_port, + node_path=self.node_path, + ) + ) + else: + self.node_server_name = self.node_port = self.node_process = None # self.server_app is included for backwards compatibility self.server_app = self.app = App.create_app( diff --git a/gradio/components/code.py b/gradio/components/code.py index f18a2f3c730a1..95f22f5ae71e8 100644 --- a/gradio/components/code.py +++ b/gradio/components/code.py @@ -29,6 +29,7 @@ class Code(Component): "html", "css", "javascript", + "jinja2", "typescript", "yaml", "dockerfile", @@ -69,6 +70,7 @@ def __init__( "html", "css", "javascript", + "jinja2", "typescript", "yaml", "dockerfile", @@ -93,7 +95,7 @@ def __init__( every: Timer | float | None = None, inputs: Component | Sequence[Component] | set[Component] | None = None, lines: int = 5, - max_lines: int = 20, + max_lines: int | None = None, label: str | None = None, interactive: bool | None = None, show_label: bool | None = None, @@ -105,6 +107,7 @@ def __init__( elem_classes: list[str] | str | None = None, render: bool = True, key: int | str | None = None, + wrap_lines: bool = False, ): """ Parameters: @@ -124,14 +127,16 @@ def __init__( render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later. key: if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved. lines: Minimum number of visible lines to show in the code editor. - max_lines: Maximum number of visible lines to show in the code editor. + max_lines: Maximum number of visible lines to show in the code editor. Defaults to None and will fill the height of the container. + wrap_lines: If True, will wrap lines to the width of the container when overflow occurs. Defaults to False. """ if language not in Code.languages: raise ValueError(f"Language {language} not supported.") self.language = language self.lines = lines - self.max_lines = max(lines, max_lines) + self.max_lines = max(lines, max_lines) if max_lines is not None else None + self.wrap_lines = wrap_lines super().__init__( label=label, every=every, diff --git a/gradio/components/native_plot.py b/gradio/components/native_plot.py index d85ebd436cfd1..f3da0fffddc60 100644 --- a/gradio/components/native_plot.py +++ b/gradio/components/native_plot.py @@ -55,6 +55,7 @@ def __init__( y_lim: list[float] | None = None, x_label_angle: float = 0, y_label_angle: float = 0, + x_axis_labels_visible: bool = True, caption: str | None = None, sort: Literal["x", "y", "-x", "-y"] | list[str] | None = None, height: int | None = None, @@ -90,6 +91,7 @@ def __init__( y_lim: A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]. x_label_angle: The angle of the x-axis labels in degrees offset clockwise. y_label_angle: The angle of the y-axis labels in degrees offset clockwise. + x_axis_labels_visible: Whether the x-axis labels should be visible. Can be hidden when many x-axis labels are present. caption: The (optional) caption to display below the plot. sort: The sorting order of the x values, if x column is type string/category. Can be "x", "y", "-x", "-y", or list of strings that represent the order of the categories. height: The height of the plot in pixels. @@ -120,6 +122,7 @@ def __init__( self.y_lim = y_lim self.x_label_angle = x_label_angle self.y_label_angle = y_label_angle + self.x_axis_labels_visible = x_axis_labels_visible self.caption = caption self.sort = sort self.height = height diff --git a/gradio/node_server.py b/gradio/node_server.py index b28ebfa643990..1b3d9f5e54db0 100644 --- a/gradio/node_server.py +++ b/gradio/node_server.py @@ -26,7 +26,6 @@ def start_node_server( server_name: str | None = None, server_port: int | None = None, node_path: str | None = None, - ssr_mode: bool | None = None, ) -> tuple[str | None, subprocess.Popen[bytes] | None, int | None]: """Launches a local server running the provided Interface Parameters: @@ -57,15 +56,11 @@ def start_node_server( else range(INITIAL_PORT_VALUE + 1, INITIAL_PORT_VALUE + 1 + TRY_NUM_PORTS) ) - node_process = None - node_port = None - - if ssr_mode: - (node_process, node_port) = start_node_process( - node_path=node_path or os.getenv("GRADIO_NODE_PATH"), - server_name=host, - server_ports=server_ports, - ) + node_process, node_port = start_node_process( + node_path=node_path or os.getenv("GRADIO_NODE_PATH"), + server_name=host, + server_ports=server_ports, + ) return server_name, node_process, node_port diff --git a/gradio/package.json b/gradio/package.json index 7ea44401db0f3..cd25d395c5094 100644 --- a/gradio/package.json +++ b/gradio/package.json @@ -1,6 +1,6 @@ { "name": "gradio", - "version": "5.0.0-beta.5", + "version": "5.0.0-beta.6", "description": "", "python": "true" } diff --git a/gradio/routes.py b/gradio/routes.py index ceccc8dcd1e8d..df9c8c51b5216 100644 --- a/gradio/routes.py +++ b/gradio/routes.py @@ -375,8 +375,7 @@ async def conditional_routing_middleware( try: return await App.proxy_to_node( request, - os.getenv("GRADIO_SERVER_NAME", blocks.local_url) - or "0.0.0.0", + blocks.node_server_name or "0.0.0.0", blocks.node_port, App.app_port, request.url.scheme, @@ -1599,12 +1598,14 @@ def read_main(): blocks.node_server_name = node_server_name blocks.node_port = node_port - blocks.node_server_name, blocks.node_process, blocks.node_port = start_node_server( - server_name=blocks.node_server_name, - server_port=blocks.node_port, - node_path=blocks.node_path, - ssr_mode=blocks.ssr_mode, - ) + if blocks.ssr_mode: + blocks.node_server_name, blocks.node_process, blocks.node_port = ( + start_node_server( + server_name=blocks.node_server_name, + server_port=blocks.node_port, + node_path=blocks.node_path, + ) + ) gradio_app = App.create_app( blocks, diff --git a/guides/01_getting-started/01_quickstart.md b/guides/01_getting-started/01_quickstart.md index 945246c9a0b0a..4df33cd350bdf 100644 --- a/guides/01_getting-started/01_quickstart.md +++ b/guides/01_getting-started/01_quickstart.md @@ -1,6 +1,6 @@ # Quickstart -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 arbitary Python function. You can then **share your demo** with a a public link in seconds using Gradio's built-in sharing features. *No JavaScript, CSS, or web hosting experience needed!* +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 your demo** with a a public link in seconds using Gradio's built-in sharing features. *No JavaScript, CSS, or web hosting experience needed!* diff --git a/js/_website/CHANGELOG.md b/js/_website/CHANGELOG.md index 01f699316dc4d..011b2ee72d02a 100644 --- a/js/_website/CHANGELOG.md +++ b/js/_website/CHANGELOG.md @@ -1,5 +1,19 @@ # website +## 0.39.0-beta.6 + +### Features + +- [#9460](https://github.com/gradio-app/gradio/pull/9460) [`7352a89`](https://github.com/gradio-app/gradio/commit/7352a89722da91461c32fd33588531f3edce9c48) - Playground requirements tab. Thanks @whitphx! +- [#9452](https://github.com/gradio-app/gradio/pull/9452) [`3ec8e63`](https://github.com/gradio-app/gradio/commit/3ec8e636766cc629444bc3cbc6b53deaf65f5ab1) - Expanding AI Playground Prompt for Qwen. Thanks @aliabd! + +### Dependency updates + +- @gradio/tabs@0.3.0-beta.3 +- @gradio/tabitem@0.3.0-beta.3 +- @gradio/code@0.10.0-beta.5 +- @gradio/paramviewer@0.4.22-beta.3 + ## 0.39.0-beta.5 ### Dependency updates @@ -59,6 +73,17 @@ - [#9206](https://github.com/gradio-app/gradio/pull/9206) [`bdbcf7b`](https://github.com/gradio-app/gradio/commit/bdbcf7b0e374c0769178767a1502cd310312278b) - Cloudflare migration. Thanks @aliabd! - [#9156](https://github.com/gradio-app/gradio/pull/9156) [`8deeeb6`](https://github.com/gradio-app/gradio/commit/8deeeb6d1b83296e5174c2891b80fb317991289e) - File access security guide. Thanks @freddyaboulton! +## 0.39.1 + +### Features + +- [#9379](https://github.com/gradio-app/gradio/pull/9379) [`0cad5f3`](https://github.com/gradio-app/gradio/commit/0cad5f348a846024b95b92fb48f88137ccfcd589) - Testing CI. Thanks @aliabd! + +### Dependency updates + +- @gradio/code@0.9.1 +- @gradio/paramviewer@0.4.22 + ## 0.39.0 ### Features diff --git a/js/_website/generate_jsons/generate.py b/js/_website/generate_jsons/generate.py index 4b48110b9095b..e49c469c3b632 100644 --- a/js/_website/generate_jsons/generate.py +++ b/js/_website/generate_jsons/generate.py @@ -6,7 +6,6 @@ from botocore import UNSIGNED from botocore.client import Config -from js._website.generate_jsons.src.docs import SYSTEM_PROMPT_8K from src import changelog, demos, docs, guides WEBSITE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) @@ -92,16 +91,20 @@ def create_dir_if_not_exists(path): demos.generate(make_dir(WEBSITE_DIR, "src/lib/json/demos.json")) guides.generate(make_dir(WEBSITE_DIR, "src/lib/json/guides/") + "/") -SYSTEM_PROMPT, SYSTEM_PROMPT_8K = docs.generate(make_dir(WEBSITE_DIR, "src/lib/json/docs.json")) -_, _ = docs.generate(make_dir(WEBSITE_DIR, "src/lib/templates/docs.json")) +SYSTEM_PROMPT = docs.generate(make_dir(WEBSITE_DIR, "src/lib/json/docs.json")) +_ = docs.generate(make_dir(WEBSITE_DIR, "src/lib/templates/docs.json")) changelog.generate(make_dir(WEBSITE_DIR, "src/lib/json/changelog.json")) get_latest_release() +# print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") +# print(SYSTEM_PROMPT) +# print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") + + with open(make_dir(WEBSITE_DIR, "src/lib/json/system_prompt.json"), "w+") as f: json.dump( { "SYSTEM": SYSTEM_PROMPT, - "SYSTEM_8K": SYSTEM_PROMPT_8K, }, f, ) diff --git a/js/_website/generate_jsons/src/docs/__init__.py b/js/_website/generate_jsons/src/docs/__init__.py index bfc4e49e499e9..524c81e8e226e 100644 --- a/js/_website/generate_jsons/src/docs/__init__.py +++ b/js/_website/generate_jsons/src/docs/__init__.py @@ -267,7 +267,7 @@ def organize_pages(): Never use any external library aside from: gradio, numpy, pandas, plotly, transformers_js and matplotlib. Do not include any code that is not necessary for the app to run. Respond with a full Gradio app. -Only respond with one full Gradio app. +Respond with a full Gradio app using correct syntax and features of the latest Gradio version. DO NOT write code that doesn't follow the signatures listed. Add comments explaining the code, but do not include any text that is not formatted as a Python comment. @@ -288,16 +288,63 @@ def greet(name): demo.launch() -Here are some more examples of Gradio apps: - +Below are all the class and function signatures in the Gradio library. """ - - -important_demos = ["annotatedimage_component", "audio_component_events", "audio_mixer", "blocks_chained_events", "blocks_essay", "blocks_essay_simple", "blocks_flipper", "blocks_form", "blocks_hello", "blocks_js_load", "blocks_js_methods", "blocks_kinematics", "blocks_layout", "blocks_plug", "blocks_simple_squares", "blocks_update", "blocks_xray", "calculator", "chatbot_consecutive", "chatbot_multimodal", "chatbot_simple", "chatbot_streaming", "chatinterface_multimodal", "custom_css", "datetimes", "diff_texts", "dropdown_key_up", "fake_diffusion", "fake_gan", "filter_records", "function_values", "gallery_component_events", "generate_tone", "hangman", "hello_blocks", "hello_blocks_decorator", "hello_world", "image_editor", "matrix_transpose", "model3D", "on_listener_decorator", "plot_component", "render_merge", "render_split", "reverse_audio_2", "sales_projections", "sentence_builder", "sepia_filter", "sort_records", "streaming_simple", "tabbed_interface_lite", "tax_calculator", "theme_soft", "timer", "timer_simple", "variable_outputs", "video_identity"] - -important_demos_8k = ["blocks_essay_simple", "blocks_flipper", "blocks_form", "blocks_hello", "blocks_kinematics", "blocks_layout", "blocks_simple_squares", "calculator", "chatbot_consecutive", "chatbot_simple", "chatbot_streaming", "chatinterface_multimodal", "datetimes", "diff_texts", "dropdown_key_up", "fake_diffusion", "filter_records", "generate_tone", "hangman", "hello_blocks", "hello_blocks_decorator", "hello_world", "image_editor", "matrix_transpose", "model3D", "on_listener_decorator", "plot_component", "render_merge", "render_split", "reverse_audio_2", "sepia_filter", "sort_records", "streaming_simple", "tabbed_interface_lite", "tax_calculator", "theme_soft", "timer", "timer_simple", "variable_outputs", "video_identity"] +for key in gradio_docs: + if key in ["events", "events_matrix"]: + continue + if "name" in key: + o = gradio_docs[key] + signature = f"""{o['name']}({', '.join([ + p['name'] + + ': ' + p['annotation'] + + (' = ' + p['default'] if 'default' in p else '') + for p in o['parameters']])})""" + SYSTEM_PROMPT += f"{signature}\n" + SYSTEM_PROMPT += f"{o['description']}\n\n" + else: + for c in gradio_docs[key]: + o = gradio_docs[key][c] + signature = f"""{o['name']}({', '.join([ + p['name'] + + ': ' + p['annotation'] + + (' = ' + p['default'] if 'default' in p else '') + for p in o['parameters']])})""" + SYSTEM_PROMPT += f"{signature}\n" + SYSTEM_PROMPT += f"{o['description']}\n\n" + if "fns" in o and key != "components": + for f in o["fns"]: + signature = f"""{o['name']}.{f['name']}({', '.join([ + p['name'] + + ': ' + p['annotation'] + + (' = ' + p['default'] if 'default' in p else '') + for p in f['parameters']])})""" + SYSTEM_PROMPT += f"{signature}\n" + SYSTEM_PROMPT += f"{f['description']}\n\n" + +SYSTEM_PROMPT += "\nEvent listeners allow Gradio to respond to user interactions with the UI components defined in a Blocks app. When a user interacts with an element, such as changing a slider value or uploading an image, a function is called.\n" + +SYSTEM_PROMPT += "All event listeners have the same signature:\n" + +f = gradio_docs["components"]["audio"]["fns"][0] +signature = f""".({', '.join([ + p['name'] + + ': ' + p['annotation'] + + (' = ' + p['default'] if 'default' in p else '') + for p in f['parameters']])})""" +SYSTEM_PROMPT += signature +SYSTEM_PROMPT += "\nEach component only supports some specific events. Below is a list of all gradio components and every event that each component supports. If an event is supported by a component, it is a valid method of the component." +for component in gradio_docs["events_matrix"]: + SYSTEM_PROMPT += f"{component}: {', '.join(gradio_docs['events_matrix'][component])}\n\n" + + +SYSTEM_PROMPT += "Below are examples of full end-to-end Gradio apps:\n\n" + +# 'audio_component_events', 'audio_mixer', 'blocks_essay', 'blocks_chained_events', 'blocks_xray', 'chatbot_multimodal', 'sentence_builder', 'custom_css', 'blocks_update', 'fake_gan' +# important_demos = ["annotatedimage_component", "blocks_essay_simple", "blocks_flipper", "blocks_form", "blocks_hello", "blocks_js_load", "blocks_js_methods", "blocks_kinematics", "blocks_layout", "blocks_plug", "blocks_simple_squares", "calculator", "chatbot_consecutive", "chatbot_simple", "chatbot_streaming", "chatinterface_multimodal", "datetimes", "diff_texts", "dropdown_key_up", "fake_diffusion", "fake_gan", "filter_records", "function_values", "gallery_component_events", "generate_tone", "hangman", "hello_blocks", "hello_blocks_decorator", "hello_world", "image_editor", "matrix_transpose", "model3D", "on_listener_decorator", "plot_component", "render_merge", "render_split", "reverse_audio_2", "sales_projections", "sepia_filter", "sort_records", "streaming_simple", "tabbed_interface_lite", "tax_calculator", "theme_soft", "timer", "timer_simple", "variable_outputs", "video_identity"] +important_demos = ['custom_css', "annotatedimage_component", "blocks_essay_simple", "blocks_flipper", "blocks_form", "blocks_hello", "blocks_js_load", "blocks_js_methods", "blocks_kinematics", "blocks_layout", "blocks_plug", "blocks_simple_squares", "calculator", "chatbot_consecutive", "chatbot_simple", "chatbot_streaming", "chatinterface_multimodal", "datetimes", "diff_texts", "dropdown_key_up", "fake_diffusion", "filter_records", "function_values", "gallery_component_events", "generate_tone", "hangman", "hello_blocks", "hello_blocks_decorator", "hello_world", "image_editor", "matrix_transpose", "model3D", "on_listener_decorator", "plot_component", "render_merge", "render_split", "reverse_audio_2", "sales_projections", "sepia_filter", "sort_records", "streaming_simple", "tabbed_interface_lite", "tax_calculator", "theme_soft", "timer", "timer_simple", "variable_outputs", "video_identity"] def length(demo): @@ -310,10 +357,8 @@ def length(demo): demo_code = demo_code.replace("# type: ignore", "").replace('if __name__ == "__main__":\n ', "") return len(demo_code) - -SYSTEM_PROMPT += "\n\nHere are some demos showcasing full Gradio apps: \n\n" - -SYSTEM_PROMPT_8K = SYSTEM_PROMPT +# important_demos = sorted(important_demos, key=length, reverse=True) +# print(important_demos) for demo in important_demos: if os.path.exists(os.path.join(DEMOS_DIR, demo, "run.py")): @@ -327,35 +372,246 @@ def length(demo): SYSTEM_PROMPT += "Code: \n\n" SYSTEM_PROMPT += f"{demo_code}\n\n" -for demo in important_demos_8k: - if os.path.exists(os.path.join(DEMOS_DIR, demo, "run.py")): - demo_file = os.path.join(DEMOS_DIR, demo, "run.py") - else: - continue - with open(demo_file) as run_py: - demo_code = run_py.read() - demo_code = demo_code.replace("# type: ignore", "").replace('if __name__ == "__main__":\n ', "") - SYSTEM_PROMPT_8K += f"Name: {demo.replace('_', ' ')}\n" - SYSTEM_PROMPT_8K += "Code: \n\n" - SYSTEM_PROMPT_8K += f"{demo_code}\n\n" - SYSTEM_PROMPT += """ +The latest verstion of Gradio includes some breaking changes, and important new features you should be aware of. Here is a list of the important changes: -The following RULES must be followed. Whenever you are forming a response, after each sentence ensure all rules have been followed otherwise start over, forming a new response and repeat until the finished response follows all the rules. then send the response. +1. Streaming audio, images, and video as input and output are now fully supported in Gradio. + +Streaming Outputs: + +In some cases, you may want to stream a sequence of outputs rather than show a single output at once. For example, you might have an image generation model and you want to show the image that is generated at each step, leading up to the final image. Or you might have a chatbot which streams its response one token at a time instead of returning it all at once. +In such cases, you can supply a generator function into Gradio instead of a regular function. +Here's an example of a Gradio app that streams a sequence of images: + +CODE: + +import gradio as gr +import numpy as np +import time + +def fake_diffusion(steps): + rng = np.random.default_rng() + for i in range(steps): + time.sleep(1) + image = rng.random(size=(600, 600, 3)) + yield image + image = np.ones((1000,1000,3), np.uint8) + image[:] = [255, 124, 0] + yield image + +demo = gr.Interface(fake_diffusion, + inputs=gr.Slider(1, 10, 3, step=1), + outputs="image") + +demo.launch() + + + +Gradio can stream audio and video directly from your generator function. This lets your user hear your audio or see your video nearly as soon as it's yielded by your function. All you have to do is + +Set streaming=True in your gr.Audio or gr.Video output component. +Write a python generator that yields the next "chunk" of audio or video. +Set autoplay=True so that the media starts playing automatically. + +For audio, the next "chunk" can be either an .mp3 or .wav file or a bytes sequence of audio. For video, the next "chunk" has to be either .mp4 file or a file with h.264 codec with a .ts extension. For smooth playback, make sure chunks are consistent lengths and larger than 1 second. + +Here's an example gradio app that streams audio: + +CODE: + +import gradio as gr +from time import sleep + +def keep_repeating(audio_file): + for _ in range(10): + sleep(0.5) + yield audio_file + +gr.Interface(keep_repeating, + gr.Audio(sources=["microphone"], type="filepath"), + gr.Audio(streaming=True, autoplay=True) +).launch() + + +Here's an example gradio app that streams video: + +CODE: + +import gradio as gr +from time import sleep + +def keep_repeating(video_file): + for _ in range(10): + sleep(0.5) + yield video_file + +gr.Interface(keep_repeating, + gr.Video(sources=["webcam"], format="mp4"), + gr.Video(streaming=True, autoplay=True) +).launch() + +Streaming Inputs: + +Gradio also allows you to stream images from a user's camera or audio chunks from their microphone into your event handler. This can be used to create real-time object detection apps or conversational chat applications with Gradio. + +Currently, the gr.Image and the gr.Audio components support input streaming via the stream event. + +Here's an example, which simply returns the webcam stream unmodified: + +CODE: + +import gradio as gr +import numpy as np +import cv2 + +def transform_cv2(frame, transform): + if transform == "cartoon": + # prepare color + img_color = cv2.pyrDown(cv2.pyrDown(frame)) + for _ in range(6): + img_color = cv2.bilateralFilter(img_color, 9, 9, 7) + img_color = cv2.pyrUp(cv2.pyrUp(img_color)) + + # prepare edges + img_edges = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) + img_edges = cv2.adaptiveThreshold( + cv2.medianBlur(img_edges, 7), + 255, + cv2.ADAPTIVE_THRESH_MEAN_C, + cv2.THRESH_BINARY, + 9, + 2, + ) + img_edges = cv2.cvtColor(img_edges, cv2.COLOR_GRAY2RGB) + # combine color and edges + img = cv2.bitwise_and(img_color, img_edges) + return img + elif transform == "edges": + # perform edge detection + img = cv2.cvtColor(cv2.Canny(frame, 100, 200), cv2.COLOR_GRAY2BGR) + return img + else: + return np.flipud(frame) + + +css=".my-group {max-width: 500px !important; max-height: 500px !important;}\n.my-column {display: flex !important; justify-content: center !important; align-items: center !important};" + +with gr.Blocks(css=css) as demo: + with gr.Column(elem_classes=["my-column"]): + with gr.Group(elem_classes=["my-group"]): + transform = gr.Dropdown(choices=["cartoon", "edges", "flip"], + value="flip", label="Transformation") + input_img = gr.Image(sources=["webcam"], type="numpy") + input_img.stream(transform_cv2, [input_img, transform], [input_img], time_limit=30, stream_every=0.1) + + +demo.launch() + + + +There are two unique keyword arguments for the stream event: + +time_limit - This is the amount of time the gradio server will spend processing the event. Media streams are naturally unbounded so it's important to set a time limit so that one user does not hog the Gradio queue. The time limit only counts the time spent processing the stream, not the time spent waiting in the queue. The orange bar displayed at the bottom of the input image represents the remaining time. When the time limit expires, the user will automatically rejoin the queue. + +stream_every - This is the frequency (in seconds) with which the stream will capture input and send it to the server. For demos like image detection or manipulation, setting a smaller value is desired to get a "real-time" effect. For demos like speech transcription, a higher value is useful so that the transcription algorithm has more context of what's being said. + + + +Your streaming function should be stateless. It should take the current input and return its corresponding output. However, there are cases where you may want to keep track of past inputs or outputs. For example, you may want to keep a buffer of the previous k inputs to improve the accuracy of your transcription demo. You can do this with Gradio's gr.State() component. + +Let's showcase this with a sample demo: + +CODE: + +def transcribe_handler(current_audio, state, transcript): + next_text = transcribe(current_audio, history=state) + state.append(current_audio) + state = state[-3:] + return state, transcript + next_text + +with gr.Blocks() as demo: + with gr.Row(): + with gr.Column(): + mic = gr.Audio(sources="microphone") + state = gr.State(value=[]) + with gr.Column(): + transcript = gr.Textbox(label="Transcript") + mic.stream(transcribe_handler, [mic, state, transcript], [state, transcript], + time_limit=10, stream_every=1) + + +demo.launch() + + +2. Audio files are no longer converted to .wav automatically + +Previously, the default value of the format in the gr.Audio component was wav, meaning that audio files would be converted to the .wav format before being processed by a prediction function or being returned to the user. Now, the default value of format is None, which means any audio files that have an existing format are kept as is. + +3. The 'every' parameter is no longer supported in event listeners + +Previously, if you wanted to run an event 'every' X seconds after a certain trigger, you could set `every=` in the event listener. This is no longer supported — do the following instead: + +- create a `gr.Timer` component, and +- use the `.tick()` method to trigger the event. + +E.g., replace something like this: + +with gr.Blocks() as demo: + a = gr.Textbox() + b = gr.Textbox() + btn = gr.Button("Start") + btn.click(lambda x:x, a, b, every=1) + +with this: + +with gr.Blocks() as demo: + a = gr.Textbox() + b = gr.Textbox() + btn = gr.Button("Start") + t = gr.Timer(1, active=False) + t.tick(lambda x:x, a, b) + btn.click(lambda: gr.Timer(active=True), None, t) + +This makes it easy to configure the timer as well to change its frequency or stop the event, e.g. + +# some code... +stop_btn = gr.Button("Stop") + stop_btn.click(lambda: gr.Timer(active=False), None, t) # deactivates timer +fast_btn = gr.Button("Fast") + fast_btn.click(lambda: gr.Timer(0.1), None, t) # makes timer tick every 0.1s + + +4. The `undo_btn`, `retry_btn` and `clear_btn` parameters of `ChatInterface` have been removed +5. Passing a tuple to `gr.Code` is not supported +6. The `concurrency_count` parameter has been removed from `.queue()` +7. The `additional_inputs_accordion_name` parameter has been removed from `gr.ChatInterface` +8. The `thumbnail` parameter has been removed from `gr.Interface` +9. The `root` parameter in `gr.FileExplorer` has been removed +10. The `signed_in_value` parameter in `gr.LoginButton` has been removed +11. The `gr.LogoutButton` component has been removed +12. The `gr.make_waveform` method has been removed from the library +13. SVGs are not accepted as input images into the `gr.Image` component unless `type=filepath` +14. The `height` parameter in `gr.DataFrame` has been renamed to `max_height` +15. The `likeable` parameter of `gr.Chatbot` has been removed. The chatbot will display like buttons whenever the `like` event is defined. +16. By default user messages are not likeable in the `gr.Chatbot`. To display like buttons in the user message, set the `user_like_button` parameter of the `like` event to True. +17. The argument for lazy-caching examples has been changed + +Previously, to lazy-cache examples, you would pass in “lazy” to the `cache_examples` parameter in `Interface`, `Chatinterface` , or `Examples`. Now, there is a separate `cache_mode` parameter, which governs whether caching should be `"lazy"` or `"eager"` . So if your code was previously: + +Now, your code should look like this: + +chatbot = gr.ChatInterface( + double, + examples=["hello", "hi"], + cache_examples=True, + cache_mode="lazy", +) -RULES: -Only respond with code, not text. -Only respond with valid Python syntax. -Never include backticks in your response such as ``` or ```python. -Never use any external library aside from: gradio, numpy, pandas, plotly, transformers_js and matplotlib. -Do not include any code that is not necessary for the app to run. -Respond with a full Gradio app. -Only respond with one full Gradio app. -Add comments explaining the code, but do not include any text that is not formatted as a Python comment. """ -SYSTEM_PROMPT_8K += """ + +SYSTEM_PROMPT += """ The following RULES must be followed. Whenever you are forming a response, after each sentence ensure all rules have been followed otherwise start over, forming a new response and repeat until the finished response follows all the rules. then send the response. @@ -363,15 +619,14 @@ def length(demo): Only respond with code, not text. Only respond with valid Python syntax. Never include backticks in your response such as ``` or ```python. -Never use any external library aside from: gradio, numpy, pandas, plotly, transformers_js and matplotlib. +Never import any external library aside from: gradio, numpy, pandas, plotly, transformers_js and matplotlib. Do not import any other library like pytesseract or PIL unless requested in the prompt. Do not include any code that is not necessary for the app to run. -Respond with a full Gradio app. +Respond with a full Gradio app using correct syntax and features of the latest Gradio version. DO NOT write code that doesn't follow the signatures listed. Only respond with one full Gradio app. Add comments explaining the code, but do not include any text that is not formatted as a Python comment. """ - def generate(json_path): with open(json_path, "w+") as f: json.dump(docs, f) - return SYSTEM_PROMPT, SYSTEM_PROMPT_8K \ No newline at end of file + return SYSTEM_PROMPT \ No newline at end of file diff --git a/js/_website/package.json b/js/_website/package.json index f599454e7eb68..e28513ab770a6 100644 --- a/js/_website/package.json +++ b/js/_website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "0.39.0-beta.5", + "version": "0.39.0-beta.6", "private": true, "scripts": { "dev": "pip install boto3 && python generate_jsons/generate.py && vite dev", diff --git a/js/_website/src/lib/components/Demos.svelte b/js/_website/src/lib/components/Demos.svelte index a1f63b74aa63f..0df16036ffa33 100644 --- a/js/_website/src/lib/components/Demos.svelte +++ b/js/_website/src/lib/components/Demos.svelte @@ -1,4 +1,6 @@ gradio.dispatch("clear_status", loading_status)} /> - + {#if show_label} + + {/if} {#if !value && !interactive} @@ -85,6 +90,7 @@ {lines} {max_lines} {dark_mode} + {wrap_lines} readonly={!interactive} on:blur={() => gradio.dispatch("blur")} on:focus={() => gradio.dispatch("focus")} diff --git a/js/code/package.json b/js/code/package.json index 3d5c4383a506a..864086324676a 100644 --- a/js/code/package.json +++ b/js/code/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/code", - "version": "0.10.0-beta.4", + "version": "0.10.0-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/code/shared/Code.svelte b/js/code/shared/Code.svelte index 1266d0f5945b9..9f0c27efacbf9 100644 --- a/js/code/shared/Code.svelte +++ b/js/code/shared/Code.svelte @@ -20,11 +20,12 @@ export let basic = true; export let language: string; export let lines = 5; - export let max_lines = 20; + export let max_lines: number | null = null; export let extensions: Extension[] = []; export let use_tab = true; export let readonly = false; export let placeholder: string | HTMLElement | null | undefined = undefined; + export let wrap_lines = false; const dispatch = createEventDispatcher<{ change: string; @@ -109,7 +110,8 @@ const minLines = lines == 1 ? 1 : lines + 1; scroller.style.minHeight = `calc(${lineHeight} * ${minLines})`; - scroller.style.maxHeight = `calc(${lineHeight} * ${max_lines + 1})`; + if (max_lines) + scroller.style.maxHeight = `calc(${lineHeight} * ${max_lines + 1})`; } function handle_change(vu: ViewUpdate): void { @@ -150,6 +152,9 @@ fontFamily: "var(--font-mono)", minHeight: "100%" }, + ".cm-gutterElement": { + marginRight: "var(--spacing-xs)" + }, ".cm-gutters": { marginRight: "1px", borderRight: "1px solid var(--border-color-primary)", @@ -201,6 +206,9 @@ } extensions.push(EditorView.updateListener.of(handle_change)); + if (wrap_lines) { + extensions.push(EditorView.lineWrapping); + } return extensions; } @@ -235,13 +243,13 @@ .wrap { display: flex; flex-direction: column; - flex-flow: column; + flex-grow: 1; margin: 0; padding: 0; height: 100%; } .codemirror-wrapper { - height: 100%; + flex-grow: 1; overflow: auto; } diff --git a/js/code/shared/Copy.svelte b/js/code/shared/Copy.svelte index e8909fc1c55f9..c1979aa266216 100644 --- a/js/code/shared/Copy.svelte +++ b/js/code/shared/Copy.svelte @@ -1,7 +1,7 @@ - - - + diff --git a/js/code/shared/Download.svelte b/js/code/shared/Download.svelte index aefdd499e57bb..f103f271ecad7 100644 --- a/js/code/shared/Download.svelte +++ b/js/code/shared/Download.svelte @@ -1,8 +1,8 @@ -
- - - {#if copied} - - {/if} - -
- - + + + diff --git a/js/code/shared/Widgets.svelte b/js/code/shared/Widgets.svelte index 584c1944077ad..014676455e75e 100644 --- a/js/code/shared/Widgets.svelte +++ b/js/code/shared/Widgets.svelte @@ -1,35 +1,13 @@ -
+ -
- - + diff --git a/js/code/shared/language.ts b/js/code/shared/language.ts index a4492bfd815c7..499bc2456e198 100644 --- a/js/code/shared/language.ts +++ b/js/code/shared/language.ts @@ -12,6 +12,7 @@ const possible_langs = [ "html", "css", "javascript", + "jinja2", "typescript", "yaml", "dockerfile", @@ -58,6 +59,10 @@ const lang_map: Record Promise) | undefined> = { css: () => import("@codemirror/lang-css").then((m) => m.css()), javascript: () => import("@codemirror/lang-javascript").then((m) => m.javascript()), + jinja2: () => + import("@codemirror/legacy-modes/mode/jinja2").then((m) => + StreamLanguage.define(m.jinja2) + ), typescript: () => import("@codemirror/lang-javascript").then((m) => m.javascript({ typescript: true }) diff --git a/js/colorpicker/CHANGELOG.md b/js/colorpicker/CHANGELOG.md index be0ddd6629e66..03dc384d7cbed 100644 --- a/js/colorpicker/CHANGELOG.md +++ b/js/colorpicker/CHANGELOG.md @@ -1,5 +1,12 @@ # @gradio/colorpicker +## 0.3.13-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.3.13-beta.2 ### Dependency updates diff --git a/js/colorpicker/package.json b/js/colorpicker/package.json index d671b103af526..33ea3265e1dfd 100644 --- a/js/colorpicker/package.json +++ b/js/colorpicker/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/colorpicker", - "version": "0.3.13-beta.2", + "version": "0.3.13-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/column/CHANGELOG.md b/js/column/CHANGELOG.md index 8e1340771693c..532374a520455 100644 --- a/js/column/CHANGELOG.md +++ b/js/column/CHANGELOG.md @@ -1,5 +1,15 @@ # @gradio/column +## 0.2.0-beta.1 + +### Features + +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 + ## 0.2.0-beta.0 ### Dependency updates diff --git a/js/column/package.json b/js/column/package.json index 3c17927e0c96f..17474dea5d51b 100644 --- a/js/column/package.json +++ b/js/column/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/column", - "version": "0.2.0-beta.0", + "version": "0.2.0-beta.1", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/component-test/CHANGELOG.md b/js/component-test/CHANGELOG.md index 166aa17232faf..9c3701b6fb87c 100644 --- a/js/component-test/CHANGELOG.md +++ b/js/component-test/CHANGELOG.md @@ -1,5 +1,11 @@ # @self/component-test +## 0.2.0-beta.5 + +### Dependency updates + +- @gradio/video@0.11.0-beta.5 + ## 0.2.0-beta.4 ### Dependency updates diff --git a/js/component-test/package.json b/js/component-test/package.json index 9923561c7bc3a..6af21147ef698 100644 --- a/js/component-test/package.json +++ b/js/component-test/package.json @@ -1,6 +1,6 @@ { "name": "@self/component-test", - "version": "0.2.0-beta.4", + "version": "0.2.0-beta.5", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/js/core/CHANGELOG.md b/js/core/CHANGELOG.md index 67a5fb695caf2..a136c1b0203ad 100644 --- a/js/core/CHANGELOG.md +++ b/js/core/CHANGELOG.md @@ -2,6 +2,29 @@ ## 0.1.0-beta.4 +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/video@0.11.0-beta.5 +- @gradio/tabs@0.3.0-beta.3 +- @gradio/column@0.2.0-beta.1 +- @gradio/tabitem@0.3.0-beta.3 +- @gradio/code@0.10.0-beta.5 +- @gradio/paramviewer@0.4.22-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 +- @gradio/button@0.3.0-beta.5 +- @gradio/markdown@0.10.0-beta.3 +- @gradio/gallery@0.13.0-beta.5 +- @gradio/plot@0.7.0-beta.4 +- @gradio/file@0.10.0-beta.5 +- @gradio/checkbox@0.4.0-beta.3 +- @gradio/image@0.16.0-beta.5 +- @gradio/textbox@0.7.0-beta.3 + +## 0.1.0-beta.4 + ### Features - [#9464](https://github.com/gradio-app/gradio/pull/9464) [`3ac5d9c`](https://github.com/gradio-app/gradio/commit/3ac5d9c972576d82bc365a6532e6e12f55441a30) - Fix plots. Thanks @pngwn! @@ -118,6 +141,13 @@ ## 0.0.4 +### Dependency updates + +- @gradio/code@0.9.1 +- @gradio/paramviewer@0.4.22 + +## 0.0.4 + ### Fixes - [#9188](https://github.com/gradio-app/gradio/pull/9188) [`8f8e1c6`](https://github.com/gradio-app/gradio/commit/8f8e1c6a0b09b0d1985b8377d94d693cb00f8a18) - Fix multiple trigger bug when function has js. Thanks @freddyaboulton! diff --git a/js/dataframe/CHANGELOG.md b/js/dataframe/CHANGELOG.md index 77b68db8afad6..e0815b1051546 100644 --- a/js/dataframe/CHANGELOG.md +++ b/js/dataframe/CHANGELOG.md @@ -1,5 +1,19 @@ # @gradio/dataframe +## 0.11.0-beta.6 + +### Features + +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! + +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 +- @gradio/button@0.3.0-beta.5 +- @gradio/markdown@0.10.0-beta.3 + ## 0.11.0-beta.5 ### Dependency updates diff --git a/js/dataframe/package.json b/js/dataframe/package.json index ab5b64fcfc8c7..0256e05b3c31d 100644 --- a/js/dataframe/package.json +++ b/js/dataframe/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/dataframe", - "version": "0.11.0-beta.5", + "version": "0.11.0-beta.6", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/dataset/CHANGELOG.md b/js/dataset/CHANGELOG.md index 0013b51ea5a5f..8077c161a03ba 100644 --- a/js/dataset/CHANGELOG.md +++ b/js/dataset/CHANGELOG.md @@ -1,5 +1,13 @@ # @gradio/dataset +## 0.2.5-beta.5 + +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/atoms@0.9.0-beta.3 +- @gradio/textbox@0.7.0-beta.3 + ## 0.2.5-beta.4 ### Dependency updates diff --git a/js/dataset/package.json b/js/dataset/package.json index 2fea9c2985df2..7491c59b84708 100644 --- a/js/dataset/package.json +++ b/js/dataset/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/dataset", - "version": "0.2.5-beta.4", + "version": "0.2.5-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/datetime/CHANGELOG.md b/js/datetime/CHANGELOG.md index d0680e0b4983f..9862cabc25881 100644 --- a/js/datetime/CHANGELOG.md +++ b/js/datetime/CHANGELOG.md @@ -1,5 +1,13 @@ # @gradio/datetime +## 0.1.4-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.1.4-beta.2 ### Dependency updates diff --git a/js/datetime/package.json b/js/datetime/package.json index 52100d41aed1d..c119d25704630 100644 --- a/js/datetime/package.json +++ b/js/datetime/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/datetime", - "version": "0.1.4-beta.2", + "version": "0.1.4-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/downloadbutton/CHANGELOG.md b/js/downloadbutton/CHANGELOG.md index c6bd17534245b..39a207d2c5cd3 100644 --- a/js/downloadbutton/CHANGELOG.md +++ b/js/downloadbutton/CHANGELOG.md @@ -1,5 +1,11 @@ # @gradio/downloadbutton +## 0.1.28-beta.5 + +### Dependency updates + +- @gradio/button@0.3.0-beta.5 + ## 0.1.28-beta.4 ### Dependency updates diff --git a/js/downloadbutton/package.json b/js/downloadbutton/package.json index a1de819763c57..6e8d621d0f6f5 100644 --- a/js/downloadbutton/package.json +++ b/js/downloadbutton/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/downloadbutton", - "version": "0.1.28-beta.4", + "version": "0.1.28-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/dropdown/CHANGELOG.md b/js/dropdown/CHANGELOG.md index abf6c6ab13dea..fe1eccab4c7e4 100644 --- a/js/dropdown/CHANGELOG.md +++ b/js/dropdown/CHANGELOG.md @@ -1,5 +1,17 @@ # @gradio/dropdown +## 0.8.0-beta.3 + +### Features + +- [#9519](https://github.com/gradio-app/gradio/pull/9519) [`0ab6ac5`](https://github.com/gradio-app/gradio/commit/0ab6ac5dc01b69e4f2462d00c4910f3354441227) - Fix change triggers for dropdown and radio. Thanks @dawoodkhan82! + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.7.13-beta.2 ### Dependency updates diff --git a/js/dropdown/Index.svelte b/js/dropdown/Index.svelte index 88fdf66708c4d..604cbbd9e3aab 100644 --- a/js/dropdown/Index.svelte +++ b/js/dropdown/Index.svelte @@ -12,16 +12,18 @@ import { StatusTracker } from "@gradio/statustracker"; import type { LoadingStatus } from "@gradio/statustracker"; + type Item = string | number; + export let label = "Dropdown"; export let info: string | undefined = undefined; export let elem_id = ""; export let elem_classes: string[] = []; export let visible = true; - export let value: string | string[] | undefined = undefined; - export let value_is_output = false; export let multiselect = false; + export let value: Item | Item[] | undefined = multiselect ? [] : undefined; + export let value_is_output = false; export let max_choices: number | null = null; - export let choices: [string, string | number][]; + export let choices: [string, Item][]; export let show_label: boolean; export let filterable: boolean; export let container = true; diff --git a/js/dropdown/dropdown.test.ts b/js/dropdown/dropdown.test.ts index 5f68733a326ca..afd308016a95b 100644 --- a/js/dropdown/dropdown.test.ts +++ b/js/dropdown/dropdown.test.ts @@ -472,7 +472,7 @@ describe("Dropdown", () => { await expect(item.value).toBe("apple_choice"); }); - test("ensure dropdown can have an empty value", async () => { + test("ensure dropdown can have the first item of the choices as a default value", async () => { const { getByLabelText } = await render(Dropdown, { show_label: true, loading_status, @@ -488,7 +488,7 @@ describe("Dropdown", () => { const item: HTMLInputElement = getByLabelText( "Dropdown" ) as HTMLInputElement; - await expect(item.value).toBe(""); + await expect(item.value).toBe("apple_choice"); }); test("ensure dropdown works when initial value is undefined and allow custom value is set", async () => { @@ -508,6 +508,6 @@ describe("Dropdown", () => { const item: HTMLInputElement = getByLabelText( "Dropdown" ) as HTMLInputElement; - await expect(item.value).toBe(""); + await expect(item.value).toBe("apple_choice"); }); }); diff --git a/js/dropdown/package.json b/js/dropdown/package.json index d8f426e4fbf3c..95b480bb41e23 100644 --- a/js/dropdown/package.json +++ b/js/dropdown/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/dropdown", - "version": "0.7.13-beta.2", + "version": "0.8.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/dropdown/shared/Dropdown.svelte b/js/dropdown/shared/Dropdown.svelte index 5acb8948a853c..9c3817a1cc0aa 100644 --- a/js/dropdown/shared/Dropdown.svelte +++ b/js/dropdown/shared/Dropdown.svelte @@ -6,13 +6,15 @@ import type { SelectData, KeyUpData } from "@gradio/utils"; import { handle_filter, handle_change, handle_shared_keys } from "./utils"; + type Item = string | number; + export let label: string; export let info: string | undefined = undefined; - export let value: string | number | (string | number)[] | undefined = []; - let old_value: string | number | (string | number)[] | undefined = []; + export let value: Item | Item[] | undefined = undefined; + let old_value: typeof value = undefined; export let value_is_output = false; - export let choices: [string, string | number][]; - let old_choices: [string, string | number][]; + export let choices: [string, Item][]; + let old_choices: typeof choices; export let disabled = false; export let show_label: boolean; export let container = true; @@ -80,12 +82,10 @@ } } - $: { - if (value != old_value) { - set_input_text(); - handle_change(dispatch, value, value_is_output); - old_value = value; - } + $: if (JSON.stringify(old_value) !== JSON.stringify(value)) { + set_input_text(); + handle_change(dispatch, value, value_is_output); + old_value = value; } function set_choice_names_values(): void { diff --git a/js/dropdown/shared/Multiselect.svelte b/js/dropdown/shared/Multiselect.svelte index 7c3213ac43ffe..e4fbb3c69e5ee 100644 --- a/js/dropdown/shared/Multiselect.svelte +++ b/js/dropdown/shared/Multiselect.svelte @@ -1,20 +1,22 @@ diff --git a/js/radio/package.json b/js/radio/package.json index 8571a9546552c..4296dab0b5dc0 100644 --- a/js/radio/package.json +++ b/js/radio/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/radio", - "version": "0.6.0-beta.2", + "version": "0.6.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/row/CHANGELOG.md b/js/row/CHANGELOG.md index 318f60a51b399..db3be0262907d 100644 --- a/js/row/CHANGELOG.md +++ b/js/row/CHANGELOG.md @@ -1,5 +1,15 @@ # @gradio/row +## 0.2.0-beta.2 + +### Features + +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 + ## 0.2.0-beta.1 ### Dependency updates diff --git a/js/row/package.json b/js/row/package.json index f781bf9544cb6..2b7c1ead76ece 100644 --- a/js/row/package.json +++ b/js/row/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/row", - "version": "0.2.0-beta.1", + "version": "0.2.0-beta.2", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/simpledropdown/CHANGELOG.md b/js/simpledropdown/CHANGELOG.md index 9b22b7d99699d..52d4bdbc3cf87 100644 --- a/js/simpledropdown/CHANGELOG.md +++ b/js/simpledropdown/CHANGELOG.md @@ -1,5 +1,13 @@ # @gradio/simpledropdown +## 0.2.13-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.2.13-beta.2 ### Dependency updates diff --git a/js/simpledropdown/package.json b/js/simpledropdown/package.json index 5538ca63b5e9d..30a097f911650 100644 --- a/js/simpledropdown/package.json +++ b/js/simpledropdown/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/simpledropdown", - "version": "0.2.13-beta.2", + "version": "0.2.13-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/simpleimage/CHANGELOG.md b/js/simpleimage/CHANGELOG.md index 8395b2a5f1078..5aba82f62ea3e 100644 --- a/js/simpleimage/CHANGELOG.md +++ b/js/simpleimage/CHANGELOG.md @@ -1,5 +1,14 @@ # @gradio/simpleimage +## 0.8.0-beta.5 + +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.8.0-beta.4 ### Dependency updates diff --git a/js/simpleimage/package.json b/js/simpleimage/package.json index 37106d66f290d..2073ce8761a87 100644 --- a/js/simpleimage/package.json +++ b/js/simpleimage/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/simpleimage", - "version": "0.8.0-beta.4", + "version": "0.8.0-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/simpletextbox/CHANGELOG.md b/js/simpletextbox/CHANGELOG.md index 16b93a8b44dc5..653758d259adc 100644 --- a/js/simpletextbox/CHANGELOG.md +++ b/js/simpletextbox/CHANGELOG.md @@ -1,5 +1,13 @@ # @gradio/simpletextbox +## 0.2.13-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.2.13-beta.2 ### Dependency updates diff --git a/js/simpletextbox/package.json b/js/simpletextbox/package.json index 78b3f1cca3639..419eea78adffa 100644 --- a/js/simpletextbox/package.json +++ b/js/simpletextbox/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/simpletextbox", - "version": "0.2.13-beta.2", + "version": "0.2.13-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/slider/CHANGELOG.md b/js/slider/CHANGELOG.md index 568ed18984c1f..c39ed8d2ad4d4 100644 --- a/js/slider/CHANGELOG.md +++ b/js/slider/CHANGELOG.md @@ -1,5 +1,16 @@ # @gradio/slider +## 0.5.0-beta.3 + +### Features + +- [#9481](https://github.com/gradio-app/gradio/pull/9481) [`2510a6e`](https://github.com/gradio-app/gradio/commit/2510a6e978a49432d7820e9518f164a70cf8acc8) - Fix `slider-color` var. Thanks @hannahblair! + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.5.0-beta.2 ### Dependency updates diff --git a/js/slider/package.json b/js/slider/package.json index d6792a6c566b2..d7e0e993dd026 100644 --- a/js/slider/package.json +++ b/js/slider/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/slider", - "version": "0.5.0-beta.2", + "version": "0.5.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/spa/CHANGELOG.md b/js/spa/CHANGELOG.md index 271a551b135f5..a5805b7e48008 100644 --- a/js/spa/CHANGELOG.md +++ b/js/spa/CHANGELOG.md @@ -2,6 +2,12 @@ ## 0.1.0-beta.2 +### Dependency updates + +- @gradio/core@0.1.0-beta.4 + +## 0.1.0-beta.2 + ### Features - [#9464](https://github.com/gradio-app/gradio/pull/9464) [`3ac5d9c`](https://github.com/gradio-app/gradio/commit/3ac5d9c972576d82bc365a6532e6e12f55441a30) - Fix plots. Thanks @pngwn! diff --git a/js/spa/test/outbreak_forecast.spec.ts b/js/spa/test/outbreak_forecast.spec.ts index d3b3b24faeba6..b0e638904b027 100644 --- a/js/spa/test/outbreak_forecast.spec.ts +++ b/js/spa/test/outbreak_forecast.spec.ts @@ -52,7 +52,25 @@ test("selecting altair should show altair plot and pressing clear should clear o await expect(altair).toHaveCount(0); }); -test("switching between all 3 plot types and pressing submit should update output component to corresponding plot type", async ({ +test("selecting bokeh should show bokeh plot and pressing clear should clear output", async ({ + page +}) => { + await page.getByLabel("Plot Type").click(); + await page.getByRole("option", { name: "bokeh" }).click(); + await page.getByLabel("Month").click(); + await page.getByRole("option", { name: "January" }).click(); + await page.getByLabel("Social Distancing?").check(); + + await page.click("text=Submit"); + + const altair = await page.getByTestId("bokeh"); + await expect(altair).toHaveCount(1); + + await page.getByRole("button", { name: "Clear" }).click(); + await expect(altair).toHaveCount(0); +}); + +test("switching between all 4 plot types and pressing submit should update output component to corresponding plot type", async ({ page }) => { //Matplotlib @@ -82,4 +100,12 @@ test("switching between all 3 plot types and pressing submit should update outpu await page.click("text=Submit"); const altair = await page.getByTestId("altair"); await expect(altair).toHaveCount(1); + + //Bokeh + await page.getByLabel("Plot Type").click(); + await page.getByRole("option", { name: "Bokeh" }).click(); + + await page.click("text=Submit"); + const bokeh = await page.getByTestId("bokeh"); + await expect(bokeh).toHaveCount(1); }); diff --git a/js/statustracker/CHANGELOG.md b/js/statustracker/CHANGELOG.md index eb62fa9300c3e..7c03b86005b1e 100644 --- a/js/statustracker/CHANGELOG.md +++ b/js/statustracker/CHANGELOG.md @@ -1,5 +1,12 @@ # @gradio/statustracker +## 0.8.0-beta.3 + +### Dependency updates + +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.8.0-beta.2 ### Features diff --git a/js/statustracker/package.json b/js/statustracker/package.json index 7555a42f8d094..db2632f5adef8 100644 --- a/js/statustracker/package.json +++ b/js/statustracker/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/statustracker", - "version": "0.8.0-beta.2", + "version": "0.8.0-beta.3", "description": "Gradio UI packages", "type": "module", "main": "./index.ts", diff --git a/js/tabitem/CHANGELOG.md b/js/tabitem/CHANGELOG.md index d5da00267bd51..1f77e829aa93b 100644 --- a/js/tabitem/CHANGELOG.md +++ b/js/tabitem/CHANGELOG.md @@ -1,5 +1,16 @@ # @gradio/tabitem +## 0.3.0-beta.3 + +### Features + +- [#9460](https://github.com/gradio-app/gradio/pull/9460) [`7352a89`](https://github.com/gradio-app/gradio/commit/7352a89722da91461c32fd33588531f3edce9c48) - Playground requirements tab. Thanks @whitphx! + +### Dependency updates + +- @gradio/tabs@0.3.0-beta.3 +- @gradio/column@0.2.0-beta.1 + ## 0.3.0-beta.2 ### Dependency updates diff --git a/js/tabitem/package.json b/js/tabitem/package.json index 3090e2ba996ae..ba4a94d34620d 100644 --- a/js/tabitem/package.json +++ b/js/tabitem/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/tabitem", - "version": "0.3.0-beta.2", + "version": "0.3.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/tabs/CHANGELOG.md b/js/tabs/CHANGELOG.md index aab4e7eb05834..3760f6e2c03df 100644 --- a/js/tabs/CHANGELOG.md +++ b/js/tabs/CHANGELOG.md @@ -1,5 +1,12 @@ # @gradio/tabs +## 0.3.0-beta.3 + +### Features + +- [#9460](https://github.com/gradio-app/gradio/pull/9460) [`7352a89`](https://github.com/gradio-app/gradio/commit/7352a89722da91461c32fd33588531f3edce9c48) - Playground requirements tab. Thanks @whitphx! +- [#9496](https://github.com/gradio-app/gradio/pull/9496) [`1647ebd`](https://github.com/gradio-app/gradio/commit/1647ebddc3e2ed6fc143a62629409e32afcc5801) - UI theme fixes. Thanks @aliabid94! + ## 0.3.0-beta.2 ### Features diff --git a/js/tabs/package.json b/js/tabs/package.json index bb3146a61e6b1..57a245a9b697a 100644 --- a/js/tabs/package.json +++ b/js/tabs/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/tabs", - "version": "0.3.0-beta.2", + "version": "0.3.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/textbox/CHANGELOG.md b/js/textbox/CHANGELOG.md index 0fb138a8df940..ec65456c3dbc3 100644 --- a/js/textbox/CHANGELOG.md +++ b/js/textbox/CHANGELOG.md @@ -1,5 +1,13 @@ # @gradio/textbox +## 0.7.0-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.7.0-beta.2 ### Dependency updates diff --git a/js/textbox/package.json b/js/textbox/package.json index 4a1f970de88d1..f0629a9dcc935 100644 --- a/js/textbox/package.json +++ b/js/textbox/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/textbox", - "version": "0.7.0-beta.2", + "version": "0.7.0-beta.3", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/tootils/CHANGELOG.md b/js/tootils/CHANGELOG.md index ab050cfa41243..c52ef7eb4e33e 100644 --- a/js/tootils/CHANGELOG.md +++ b/js/tootils/CHANGELOG.md @@ -1,5 +1,11 @@ # @self/tootils +## 0.6.5-beta.3 + +### Dependency updates + +- @gradio/statustracker@0.8.0-beta.3 + ## 0.6.5-beta.2 ### Dependency updates diff --git a/js/tootils/package.json b/js/tootils/package.json index e6d1c4ecdaaf1..ac1d1a65eca9e 100644 --- a/js/tootils/package.json +++ b/js/tootils/package.json @@ -1,6 +1,6 @@ { "name": "@self/tootils", - "version": "0.6.5-beta.2", + "version": "0.6.5-beta.3", "description": "Internal test utilities", "type": "module", "main": "src/index.ts", diff --git a/js/upload/CHANGELOG.md b/js/upload/CHANGELOG.md index 5dda85e1670a5..c599af3a7eb2d 100644 --- a/js/upload/CHANGELOG.md +++ b/js/upload/CHANGELOG.md @@ -1,5 +1,12 @@ # @gradio/upload +## 0.13.0-beta.5 + +### Dependency updates + +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 + ## 0.13.0-beta.4 ### Dependency updates diff --git a/js/upload/package.json b/js/upload/package.json index 62da836f33e0d..599465148bac2 100644 --- a/js/upload/package.json +++ b/js/upload/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/upload", - "version": "0.13.0-beta.4", + "version": "0.13.0-beta.5", "description": "Gradio UI packages", "type": "module", "main": "src/index.ts", diff --git a/js/uploadbutton/CHANGELOG.md b/js/uploadbutton/CHANGELOG.md index 9a3c8105accc3..03de37d262d52 100644 --- a/js/uploadbutton/CHANGELOG.md +++ b/js/uploadbutton/CHANGELOG.md @@ -1,5 +1,12 @@ # @gradio/uploadbutton +## 0.7.0-beta.5 + +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/button@0.3.0-beta.5 + ## 0.7.0-beta.4 ### Dependency updates diff --git a/js/uploadbutton/package.json b/js/uploadbutton/package.json index ab812fafe2cf4..1f4e6d37ab78f 100644 --- a/js/uploadbutton/package.json +++ b/js/uploadbutton/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/uploadbutton", - "version": "0.7.0-beta.4", + "version": "0.7.0-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/js/video/CHANGELOG.md b/js/video/CHANGELOG.md index d4834b271f092..58b7f911bca39 100644 --- a/js/video/CHANGELOG.md +++ b/js/video/CHANGELOG.md @@ -1,5 +1,15 @@ # @gradio/video +## 0.11.0-beta.5 + +### Dependency updates + +- @gradio/upload@0.13.0-beta.5 +- @gradio/statustracker@0.8.0-beta.3 +- @gradio/icons@0.8.0-beta.3 +- @gradio/atoms@0.9.0-beta.3 +- @gradio/image@0.16.0-beta.5 + ## 0.11.0-beta.4 ### Dependency updates diff --git a/js/video/package.json b/js/video/package.json index 1bd6051d44185..209af6f3d2455 100644 --- a/js/video/package.json +++ b/js/video/package.json @@ -1,6 +1,6 @@ { "name": "@gradio/video", - "version": "0.11.0-beta.4", + "version": "0.11.0-beta.5", "description": "Gradio UI packages", "type": "module", "author": "", diff --git a/requirements.txt b/requirements.txt index beefd9af1cd6b..b8b976efd2911 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ aiofiles>=22.0,<24.0 anyio>=3.0,<5.0 fastapi<1.0 ffmpy -gradio_client==1.4.0-beta.2 +gradio_client==1.4.0-beta.3 httpx>=0.24.1 huggingface_hub>=0.22.0 Jinja2<4.0 diff --git a/test/components/test_code.py b/test/components/test_code.py index 072e46d34c815..1d4169c73c1fb 100644 --- a/test/components/test_code.py +++ b/test/components/test_code.py @@ -32,7 +32,7 @@ def fn(a): "value": None, "language": None, "lines": 5, - "max_lines": 20, + "max_lines": None, "name": "code", "show_label": True, "label": None, @@ -45,6 +45,7 @@ def fn(a): "interactive": None, "proxy_url": None, "_selectable": False, + "wrap_lines": False, "key": None, }