Skip to content

fix spaces#2567

Merged
abidlabs merged 10 commits into
mainfrom
fix-spaces
Oct 30, 2022
Merged

fix spaces#2567
abidlabs merged 10 commits into
mainfrom
fix-spaces

Conversation

@pngwn
Copy link
Copy Markdown
Member

@pngwn pngwn commented Oct 30, 2022

Ensure spaces always uses correct api endpoint when queueing.

Description

Please include:

  • relevant motivation
  • a summary of the change
  • which issue is fixed.
  • any additional dependencies that are required for this change.

Closes: # (issue)

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

@github-actions
Copy link
Copy Markdown
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2567-all-demos

@pngwn pngwn requested review from abidlabs and aliabid94 October 30, 2022 02:27
@abidlabs
Copy link
Copy Markdown
Member

Going to release a beta version so I can test this out on Spaces

@abidlabs
Copy link
Copy Markdown
Member

Hey @pngwn I don't think this is working for me correctly.

  1. I made a release from this branch: gradio==3.8b1
  2. I created a Space using this version of gradio: https://huggingface.co/spaces/abidlabs/test-3.8b1
  3. I then tried to embed this Space using the following code:
<!DOCTYPE html>
<html>
<body>


<script type="module"
src="https://gradio.s3-us-west-2.amazonaws.com/3.8b1/gradio.js">
</script>

<gradio-app space="abidlabs/test-3.8b1"></gradio-app>


</body>
</html>

However, I get the same error:

image

Here's the console:

WebSocket connection to 'ws://abidlabs-test-3-8b1.hf.space/C:/Users/islam/Desktop/index.htmlqueue/join' failed

In other words, now it looks like both the Space URL and the embedding URL are being combined together


Note that if I do the same steps using gradio==3.8, I get the same error, but the URL looks a bit different:

WebSocket connection to 'wss://c/Users/islam/Desktop/index.htmlqueue/join

@pngwn
Copy link
Copy Markdown
Member Author

pngwn commented Oct 30, 2022

Ah, you're seeing this because you aren't running the html on a server locally but this same error would have occurred if the gradio embed was on a non root path. I've pushed a fix that should resolve that.

@abidlabs
Copy link
Copy Markdown
Member

LGTM! Let me update the version and we can merge this in

Copy link
Copy Markdown
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.

Works beautifully, thanks for fixing this @pngwn!

@abidlabs abidlabs merged commit 36e383a into main Oct 30, 2022
@abidlabs abidlabs deleted the fix-spaces branch October 30, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants