-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change client submit API to be an AsyncIterable and support more platforms #8451
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0735ead
fix param name
pngwn 7c3d945
format
pngwn f879b2c
save
pngwn adb6015
changes
pngwn d805056
changes
pngwn 9fe5683
fix param name
pngwn 209d34b
format
pngwn 241881e
Merge branch 'main' into 8207-fetch-stream-2
pngwn 4e15789
switch to async iterable interface
pngwn d0a78b2
switch to async iterable interface
pngwn 67bf81f
changes
pngwn fc9403e
add changeset
gradio-pr-bot d373899
fix
pngwn 9c60718
Merge branch 'main' into 8207-fetch-stream-2
pngwn db4605b
fix param name
pngwn a06524d
format
pngwn 7d5b455
Merge branch 'main' into 8207-fetch-stream-2
pngwn 2c75b44
fixes
pngwn 06980e7
fix checks
pngwn 10a486e
fix checks
pngwn 289797d
add changeset
gradio-pr-bot 1df909a
fix checks
pngwn 0616b91
add changeset
gradio-pr-bot dae21f4
add changeset
gradio-pr-bot 5336b6b
fix checks
pngwn 669ee00
fix param name
pngwn 8720be7
format
pngwn 6937397
Merge branch 'main' into 8207-fetch-stream-2
pngwn cbf6d50
fix types
pngwn d42dc9c
cleanup comments
pngwn 7cc8898
add changeset
gradio-pr-bot 1239f49
fix param name
pngwn da6b68e
format
pngwn 2e8a3cc
changes
pngwn c0e98a5
Refactor Cancelling Logic To Use /cancel (#8370)
freddyaboulton e971f09
fix param name
pngwn f7e96bb
format
pngwn 9ccc867
changes
pngwn a63c330
Merge branch 'main' into 8207-fetch-stream-2
pngwn 778de68
fix
pngwn e4789d6
fix param name
pngwn 5d28bf2
format
pngwn 8795f7f
Merge branch 'main' into 8207-fetch-stream-2
pngwn b5e6488
fix test
pngwn 5bf5067
fix notebooks
pngwn 4cacbf3
fix type
pngwn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@gradio/app": patch | ||
"@gradio/client": patch | ||
"@gradio/file": patch | ||
"@gradio/spaces-test": patch | ||
"gradio": patch | ||
--- | ||
|
||
fix:Change client submit API to be an AsyncIterable and support more platforms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!doctype html> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Client</title> | ||
<script type="module"> | ||
import { Client } from "./dist/index.js"; | ||
console.log(Client); | ||
|
||
const client = await Client.connect("pngwn/chatinterface_streaming_echo"); | ||
async function run(message, n) { | ||
// console.log(client); | ||
const req = client.submit("/chat", { | ||
message | ||
}); | ||
console.log("start"); | ||
for await (const c of req) { | ||
if (c.type === "data") { | ||
console.log(`${n}: ${c.data[0]}`); | ||
} | ||
} | ||
|
||
console.log("end"); | ||
|
||
return "hi"; | ||
} | ||
|
||
run("My name is frank", 1); | ||
run("Hello there", 2); | ||
|
||
console.log("boo"); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ describe("upload_files", () => { | |
expect(response.files[0]).toBe("lion.jpg"); | ||
}); | ||
|
||
it("should handle a server error when connected to a running app and uploading files", async () => { | ||
it.skip("should handle a server error when connected to a running app and uploading files", async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. file issue |
||
const client = await Client.connect("hmb/server_test"); | ||
|
||
const root_url = "https://hmb-server-test.hf.space"; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using it to test, will delete just before merge