Upload folder using huggingface_hub
Browse files
6.4.0/file/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/file",
|
| 3 |
-
"version": "0.14.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/file",
|
| 3 |
+
"version": "0.14.1",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
6.4.0/file/shared/FileUpload.svelte
CHANGED
|
@@ -28,9 +28,7 @@
|
|
| 28 |
export let buttons: (string | CustomButtonType)[] | null = null;
|
| 29 |
export let on_custom_button_click: ((id: number) => void) | null = null;
|
| 30 |
|
| 31 |
-
async function handle_upload({
|
| 32 |
-
detail
|
| 33 |
-
}: CustomEvent<FileData | FileData[]>): Promise<void> {
|
| 34 |
if (Array.isArray(value)) {
|
| 35 |
value = [...value, ...(Array.isArray(detail) ? detail : [detail])];
|
| 36 |
} else if (value) {
|
|
@@ -74,14 +72,14 @@
|
|
| 74 |
<Upload
|
| 75 |
bind:upload_promise
|
| 76 |
icon_upload={true}
|
| 77 |
-
|
| 78 |
filetype={file_types}
|
| 79 |
{file_count}
|
| 80 |
{max_file_size}
|
| 81 |
{root}
|
| 82 |
bind:dragging
|
| 83 |
bind:uploading
|
| 84 |
-
|
| 85 |
{stream_handler}
|
| 86 |
{upload}
|
| 87 |
/>
|
|
@@ -90,7 +88,7 @@
|
|
| 90 |
<IconButton
|
| 91 |
Icon={Clear}
|
| 92 |
label={i18n("common.clear")}
|
| 93 |
-
|
| 94 |
dispatch("clear");
|
| 95 |
event.stopPropagation();
|
| 96 |
handle_clear();
|
|
@@ -111,14 +109,14 @@
|
|
| 111 |
{:else}
|
| 112 |
<Upload
|
| 113 |
bind:upload_promise
|
| 114 |
-
|
| 115 |
filetype={file_types}
|
| 116 |
{file_count}
|
| 117 |
{max_file_size}
|
| 118 |
{root}
|
| 119 |
bind:dragging
|
| 120 |
bind:uploading
|
| 121 |
-
|
| 122 |
{stream_handler}
|
| 123 |
{upload}
|
| 124 |
{height}
|
|
|
|
| 28 |
export let buttons: (string | CustomButtonType)[] | null = null;
|
| 29 |
export let on_custom_button_click: ((id: number) => void) | null = null;
|
| 30 |
|
| 31 |
+
async function handle_upload(detail: FileData | FileData[]): Promise<void> {
|
|
|
|
|
|
|
| 32 |
if (Array.isArray(value)) {
|
| 33 |
value = [...value, ...(Array.isArray(detail) ? detail : [detail])];
|
| 34 |
} else if (value) {
|
|
|
|
| 72 |
<Upload
|
| 73 |
bind:upload_promise
|
| 74 |
icon_upload={true}
|
| 75 |
+
onload={handle_upload}
|
| 76 |
filetype={file_types}
|
| 77 |
{file_count}
|
| 78 |
{max_file_size}
|
| 79 |
{root}
|
| 80 |
bind:dragging
|
| 81 |
bind:uploading
|
| 82 |
+
onerror={(e) => dispatch("error", e)}
|
| 83 |
{stream_handler}
|
| 84 |
{upload}
|
| 85 |
/>
|
|
|
|
| 88 |
<IconButton
|
| 89 |
Icon={Clear}
|
| 90 |
label={i18n("common.clear")}
|
| 91 |
+
onclick={(event) => {
|
| 92 |
dispatch("clear");
|
| 93 |
event.stopPropagation();
|
| 94 |
handle_clear();
|
|
|
|
| 109 |
{:else}
|
| 110 |
<Upload
|
| 111 |
bind:upload_promise
|
| 112 |
+
onload={handle_upload}
|
| 113 |
filetype={file_types}
|
| 114 |
{file_count}
|
| 115 |
{max_file_size}
|
| 116 |
{root}
|
| 117 |
bind:dragging
|
| 118 |
bind:uploading
|
| 119 |
+
onerror={(e) => dispatch("error", e)}
|
| 120 |
{stream_handler}
|
| 121 |
{upload}
|
| 122 |
{height}
|