Upload folder using huggingface_hub
Browse files
6.4.0/multimodaltextbox/shared/MultimodalTextbox.svelte
CHANGED
|
@@ -208,9 +208,7 @@
|
|
| 208 |
}
|
| 209 |
}
|
| 210 |
|
| 211 |
-
async function handle_upload({
|
| 212 |
-
detail
|
| 213 |
-
}: CustomEvent<FileData>): Promise<void> {
|
| 214 |
handle_change();
|
| 215 |
if (Array.isArray(detail)) {
|
| 216 |
for (let file of detail) {
|
|
@@ -360,19 +358,14 @@
|
|
| 360 |
{root}
|
| 361 |
{max_file_size}
|
| 362 |
bind:upload_promise
|
| 363 |
-
|
| 364 |
-
mic_audio =
|
| 365 |
}}
|
| 366 |
-
|
| 367 |
recording = false;
|
| 368 |
dispatch("stop_recording");
|
| 369 |
}}
|
| 370 |
-
|
| 371 |
-
active_source = null;
|
| 372 |
-
recording = false;
|
| 373 |
-
mic_audio = null;
|
| 374 |
-
}}
|
| 375 |
-
on:error={({ detail }) => {
|
| 376 |
active_source = null;
|
| 377 |
recording = false;
|
| 378 |
mic_audio = null;
|
|
@@ -418,7 +411,7 @@
|
|
| 418 |
<Upload
|
| 419 |
bind:upload_promise
|
| 420 |
bind:this={upload_component}
|
| 421 |
-
|
| 422 |
{file_count}
|
| 423 |
filetype={file_types}
|
| 424 |
{root}
|
|
@@ -427,7 +420,7 @@
|
|
| 427 |
bind:uploading
|
| 428 |
show_progress={false}
|
| 429 |
disable_click={true}
|
| 430 |
-
|
| 431 |
hidden={true}
|
| 432 |
{upload}
|
| 433 |
{stream_handler}
|
|
|
|
| 208 |
}
|
| 209 |
}
|
| 210 |
|
| 211 |
+
async function handle_upload(detail: FileData | FileData[]): Promise<void> {
|
|
|
|
|
|
|
| 212 |
handle_change();
|
| 213 |
if (Array.isArray(detail)) {
|
| 214 |
for (let file of detail) {
|
|
|
|
| 358 |
{root}
|
| 359 |
{max_file_size}
|
| 360 |
bind:upload_promise
|
| 361 |
+
onchange={(value) => {
|
| 362 |
+
mic_audio = value;
|
| 363 |
}}
|
| 364 |
+
onstoprecording={() => {
|
| 365 |
recording = false;
|
| 366 |
dispatch("stop_recording");
|
| 367 |
}}
|
| 368 |
+
onclear={() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 369 |
active_source = null;
|
| 370 |
recording = false;
|
| 371 |
mic_audio = null;
|
|
|
|
| 411 |
<Upload
|
| 412 |
bind:upload_promise
|
| 413 |
bind:this={upload_component}
|
| 414 |
+
onload={handle_upload}
|
| 415 |
{file_count}
|
| 416 |
filetype={file_types}
|
| 417 |
{root}
|
|
|
|
| 420 |
bind:uploading
|
| 421 |
show_progress={false}
|
| 422 |
disable_click={true}
|
| 423 |
+
onerror={(e) => dispatch("error", e)}
|
| 424 |
hidden={true}
|
| 425 |
{upload}
|
| 426 |
{stream_handler}
|