Skip to content
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

fix upload file delay #4661

Merged
merged 4 commits into from Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -18,6 +18,7 @@
- Fixed Dropdown height rendering in Columns by [@aliabid94](https://github.com/aliabid94) in [PR 4584](https://github.com/gradio-app/gradio/pull/4584)
- Fixed bug where `AnnotatedImage` css styling was causing the annotation masks to not be displayed correctly by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4628](https://github.com/gradio-app/gradio/pull/4628)
- Ensure that Gradio does not silently fail when running on a port that is occupied by [@abidlabs](https://github.com/abidlabs) in [PR 4624](https://github.com/gradio-app/gradio/pull/4624).
- Fix double upload bug that caused lag in file uploads by [@aliabid94](https://github.com/aliabid94) in [PR 4661](https://github.com/gradio-app/gradio/pull/4661)

## Other Changes:

Expand Down
4 changes: 3 additions & 1 deletion js/app/src/components/File/File.svelte
Expand Up @@ -71,6 +71,7 @@
(Array.isArray(_value) ? _value : [_value]).forEach(
async (file_data, i) => {
file_data.data = await blobToBase64(file_data.blob!);
file_data.blob = undefined;
}
);
} else {
Expand All @@ -80,10 +81,11 @@
file_data.orig_name = file_data.name;
file_data.name = response.files[i];
file_data.is_file = true;
file_data.blob = undefined;
}
}
);
_value = normalise_file(value, root, root_url);
old_value = _value = normalise_file(value, root, root_url);
}
dispatch("change");
dispatch("upload");
Expand Down
2 changes: 2 additions & 0 deletions js/app/src/components/UploadButton/UploadButton.svelte
Expand Up @@ -32,6 +32,7 @@
(Array.isArray(detail) ? detail : [detail]).forEach(
async (file_data, i) => {
file_data.data = await blobToBase64(file_data.blob!);
file_data.blob = undefined;
}
);
} else {
Expand All @@ -40,6 +41,7 @@
file_data.orig_name = file_data.name;
file_data.name = response.files[i];
file_data.is_file = true;
file_data.blob = undefined;
}
});
}
Expand Down