Upload folder using huggingface_hub
Browse files
6.4.0/gallery/Index.svelte
CHANGED
|
@@ -137,7 +137,7 @@
|
|
| 137 |
}}
|
| 138 |
ondelete={handle_delete}
|
| 139 |
onupload={async (e) => {
|
| 140 |
-
const files = Array.isArray(e
|
| 141 |
const new_value = await process_upload_files(files);
|
| 142 |
gradio.props.value = gradio.props.value
|
| 143 |
? [...gradio.props.value, ...new_value]
|
|
|
|
| 137 |
}}
|
| 138 |
ondelete={handle_delete}
|
| 139 |
onupload={async (e) => {
|
| 140 |
+
const files = Array.isArray(e) ? e : [e];
|
| 141 |
const new_value = await process_upload_files(files);
|
| 142 |
gradio.props.value = gradio.props.value
|
| 143 |
? [...gradio.props.value, ...new_value]
|
6.4.0/gallery/shared/Gallery.svelte
CHANGED
|
@@ -545,17 +545,20 @@
|
|
| 545 |
}}
|
| 546 |
>
|
| 547 |
{#if upload && stream_handler}
|
| 548 |
-
<IconButton
|
|
|
|
|
|
|
|
|
|
| 549 |
<UploadComponent
|
| 550 |
bind:upload_promise
|
| 551 |
icon_upload={true}
|
| 552 |
-
|
| 553 |
filetype={file_types}
|
| 554 |
file_count="multiple"
|
| 555 |
{max_file_size}
|
| 556 |
{root}
|
| 557 |
bind:uploading
|
| 558 |
-
|
| 559 |
{stream_handler}
|
| 560 |
{upload}
|
| 561 |
/>
|
|
|
|
| 545 |
}}
|
| 546 |
>
|
| 547 |
{#if upload && stream_handler}
|
| 548 |
+
<IconButton
|
| 549 |
+
Icon={UploadIcon}
|
| 550 |
+
label={i18n("upload_text.click_to_upload")}
|
| 551 |
+
>
|
| 552 |
<UploadComponent
|
| 553 |
bind:upload_promise
|
| 554 |
icon_upload={true}
|
| 555 |
+
onload={(e) => onupload(e)}
|
| 556 |
filetype={file_types}
|
| 557 |
file_count="multiple"
|
| 558 |
{max_file_size}
|
| 559 |
{root}
|
| 560 |
bind:uploading
|
| 561 |
+
onerror={(e) => onerror(e)}
|
| 562 |
{stream_handler}
|
| 563 |
{upload}
|
| 564 |
/>
|