Skip to content

Conversation

@freddyaboulton
Copy link
Collaborator

@freddyaboulton freddyaboulton commented Dec 11, 2025

Description

Closes: #12521
Closes: #12492

Before

image

After

image

Testing with this demo

import time

import gradio as gr

print(f"Gradio: {gr.__version__}")


def run_import():
    start = time.perf_counter()
    import torch

    print(f"PyTorch: {torch.__version__}")
    return time.perf_counter() - start


def callback():
    elapsed = run_import()
    print(f"Inside callback: {elapsed:.2f}s")
    return f"{elapsed:.2f}s"


with gr.Blocks() as demo:
    gr.Button("Test").click(callback, outputs=gr.Textbox())

demo.launch()

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • I used AI to... [fill here]
  • I did not use AI

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Testing and Formatting Your Code

  1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests: bash scripts/run_backend_tests.sh

  2. Please run these bash scripts to automatically format your code: bash scripts/format_backend.sh, and (if you made any changes to non-Python files) bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Dec 11, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/599241021a607067722d1e01d370560a6982d495/gradio-6.1.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@599241021a607067722d1e01d370560a6982d495#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/599241021a607067722d1e01d370560a6982d495/gradio-client-2.0.0.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Dec 11, 2025

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch

  • Use a slower check rate on windows, otherwise windows locks up

✅ Changeset approved by @freddyaboulton

  • Maintainers can remove approval by unchecking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@freddyaboulton freddyaboulton marked this pull request as ready for review December 11, 2025 22:53
Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow I wouldn't have expected that but Windows 🤷. LGTM since although I can't test it, this is the only major change to the queue that we (I) made. Thanks for the fix @freddyaboulton!

@FurkanGozukara
Copy link

i just tested this https://gradio-pypi-previews.s3.amazonaws.com/dff7e77e5a072a3c8b0832c248962a2708cb1adb/gradio-6.1.0-py3-none-any.whl

sadly didnt fix

if there is some debug parameter i can set i can try and give you feedback

@freddyaboulton
Copy link
Collaborator Author

yea it's bizzarro Thanks for reviewing!

self.sleep_when_free = 0.001
self.progress_update_sleep_when_free = 0.01
self.sleep_when_free = 0.05 if platform.system() == "Windows" else 0.001
self.progress_update_sleep_when_free = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw previously this was:

    self.progress_update_sleep_when_free = 0.1

@abidlabs
Copy link
Member

@FurkanGozukara
Copy link

hmm there's also this change in the original PR:

image https://github.com//pull/12296/files#diff-cab37b7b6ce45220156832fd4ea1597bedcb26f5cfc43ab5c678fc8a586a0232

this one failed

(venv) F:\Paints_UNDO_v6\Paints-UNDO\venv\Scripts>pip install https://github.com/gradio-app/gradio/pull/12296/files#diff-cab37b7b6ce45220156832fd4ea1597bedcb26f5cfc43ab5c678fc8a586a0232
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting https://github.com/gradio-app/gradio/pull/12296/files#diff-cab37b7b6ce45220156832fd4ea1597bedcb26f5cfc43ab5c678fc8a586a0232
  Downloading https://github.com/gradio-app/gradio/pull/12296/files
     | 378.1 kB 2.2 MB/s 0:00:00
  ERROR: Cannot unpack file C:\Users\Furkan\AppData\Local\Temp\pip-unpack-ti0jt7sj\files (downloaded from C:\Users\Furkan\AppData\Local\Temp\pip-req-build-wsrnjjbi, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\Furkan\AppData\Local\Temp\pip-req-build-wsrnjjbi

(venv) F:\Paints_UNDO_v6\Paints-UNDO\venv\Scripts>

@freddyaboulton
Copy link
Collaborator Author

Thanks for checking @FurkanGozukara - can you please try with this one?

https://gradio-pypi-previews.s3.amazonaws.com/599241021a607067722d1e01d370560a6982d495/gradio-6.1.0-py3-none-any.whl

@FurkanGozukara
Copy link

FurkanGozukara commented Dec 12, 2025

https://gradio-pypi-previews.s3.amazonaws.com/599241021a607067722d1e01d370560a6982d495/gradio-6.1.0-py3-none-any.whl

yes this worked on one of the 1 apps that was broken. works same as 5.5.0

i am using python 3.10.11

excellent work thank you @freddyaboulton

@freddyaboulton
Copy link
Collaborator Author

Thank you for checking @FurkanGozukara !

@freddyaboulton freddyaboulton merged commit b3a3683 into main Dec 12, 2025
21 checks passed
@freddyaboulton freddyaboulton deleted the fix-windows-issue branch December 12, 2025 14:05
@FurkanGozukara
Copy link

@freddyaboulton thank you so much. when can we expect this in release? 6.1.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants