Upload folder using huggingface_hub
Browse files
6.19.0/chatbot/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/chatbot",
|
| 3 |
-
"version": "0.
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@gradio/chatbot",
|
| 3 |
+
"version": "0.31.0",
|
| 4 |
"description": "Gradio UI packages",
|
| 5 |
"type": "module",
|
| 6 |
"author": "",
|
6.19.0/chatbot/shared/ChatBot.svelte
CHANGED
|
@@ -184,6 +184,12 @@
|
|
| 184 |
let scroll_after_component_load = $state(false);
|
| 185 |
let has_scrolled_on_mount = false;
|
| 186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
async function scroll_on_value_update(): Promise<void> {
|
| 188 |
if (!autoscroll) return;
|
| 189 |
if (is_at_bottom()) {
|
|
@@ -399,7 +405,7 @@
|
|
| 399 |
handle_action(i, messages[0], selected);
|
| 400 |
}
|
| 401 |
}}
|
| 402 |
-
scroll={is_browser ?
|
| 403 |
{allow_file_downloads}
|
| 404 |
{onerror}
|
| 405 |
{onshare}
|
|
|
|
| 184 |
let scroll_after_component_load = $state(false);
|
| 185 |
let has_scrolled_on_mount = false;
|
| 186 |
|
| 187 |
+
function scroll_to_bottom_after_component_load(): void {
|
| 188 |
+
if (scroll_after_component_load) {
|
| 189 |
+
scroll_to_bottom();
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
async function scroll_on_value_update(): Promise<void> {
|
| 194 |
if (!autoscroll) return;
|
| 195 |
if (is_at_bottom()) {
|
|
|
|
| 405 |
handle_action(i, messages[0], selected);
|
| 406 |
}
|
| 407 |
}}
|
| 408 |
+
scroll={is_browser ? scroll_to_bottom_after_component_load : () => {}}
|
| 409 |
{allow_file_downloads}
|
| 410 |
{onerror}
|
| 411 |
{onshare}
|
6.19.0/chatbot/shared/Component.svelte
CHANGED
|
@@ -50,6 +50,10 @@
|
|
| 50 |
document.exitFullscreen?.();
|
| 51 |
}
|
| 52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
</script>
|
| 54 |
|
| 55 |
{#if type === "gallery"}
|
|
@@ -65,7 +69,7 @@
|
|
| 65 |
interactive={false}
|
| 66 |
mode="minimal"
|
| 67 |
fixed_height={1}
|
| 68 |
-
on:load={
|
| 69 |
/>
|
| 70 |
{:else if type === "dataframe"}
|
| 71 |
<svelte:component
|
|
@@ -83,7 +87,7 @@
|
|
| 83 |
latex_delimiters={props.latex_delimiters}
|
| 84 |
col_count={props.col_count}
|
| 85 |
row_count={props.row_count}
|
| 86 |
-
on:load={
|
| 87 |
/>
|
| 88 |
{:else if type === "plot"}
|
| 89 |
<svelte:component
|
|
@@ -96,7 +100,7 @@
|
|
| 96 |
bokeh_version={props.bokeh_version}
|
| 97 |
caption={props.caption || ""}
|
| 98 |
show_actions_button={true}
|
| 99 |
-
on:load={
|
| 100 |
/>
|
| 101 |
{:else if type === "audio"}
|
| 102 |
<svelte:component
|
|
@@ -113,7 +117,7 @@
|
|
| 113 |
show_download_button={false}
|
| 114 |
display_icon_button_wrapper_top_corner={false}
|
| 115 |
minimal={true}
|
| 116 |
-
on:load={
|
| 117 |
/>
|
| 118 |
{:else if type === "video"}
|
| 119 |
<svelte:component
|
|
@@ -127,7 +131,7 @@
|
|
| 127 |
{upload}
|
| 128 |
display_icon_button_wrapper_top_corner={false}
|
| 129 |
show_download_button={false}
|
| 130 |
-
on:load={
|
| 131 |
>
|
| 132 |
<track kind="captions" />
|
| 133 |
</svelte:component>
|
|
@@ -143,7 +147,7 @@
|
|
| 143 |
fullscreen={image_fullscreen}
|
| 144 |
show_button_background={false}
|
| 145 |
on:fullscreen={handle_fullscreen}
|
| 146 |
-
on:load={
|
| 147 |
{i18n}
|
| 148 |
/>
|
| 149 |
</div>
|
|
@@ -152,7 +156,7 @@
|
|
| 152 |
this={components[type]}
|
| 153 |
{...props}
|
| 154 |
props={{ value }}
|
| 155 |
-
on:load={
|
| 156 |
/>
|
| 157 |
{:else if type === "model3d"}
|
| 158 |
<svelte:component
|
|
@@ -172,7 +176,7 @@
|
|
| 172 |
interactive={false}
|
| 173 |
show_share_button={false}
|
| 174 |
gradio={{ dispatch: () => {}, i18n }}
|
| 175 |
-
on:load={
|
| 176 |
{i18n}
|
| 177 |
/>
|
| 178 |
{/if}
|
|
|
|
| 50 |
document.exitFullscreen?.();
|
| 51 |
}
|
| 52 |
}
|
| 53 |
+
|
| 54 |
+
function handle_load(): void {
|
| 55 |
+
onload?.();
|
| 56 |
+
}
|
| 57 |
</script>
|
| 58 |
|
| 59 |
{#if type === "gallery"}
|
|
|
|
| 69 |
interactive={false}
|
| 70 |
mode="minimal"
|
| 71 |
fixed_height={1}
|
| 72 |
+
on:load={handle_load}
|
| 73 |
/>
|
| 74 |
{:else if type === "dataframe"}
|
| 75 |
<svelte:component
|
|
|
|
| 87 |
latex_delimiters={props.latex_delimiters}
|
| 88 |
col_count={props.col_count}
|
| 89 |
row_count={props.row_count}
|
| 90 |
+
on:load={handle_load}
|
| 91 |
/>
|
| 92 |
{:else if type === "plot"}
|
| 93 |
<svelte:component
|
|
|
|
| 100 |
bokeh_version={props.bokeh_version}
|
| 101 |
caption={props.caption || ""}
|
| 102 |
show_actions_button={true}
|
| 103 |
+
on:load={handle_load}
|
| 104 |
/>
|
| 105 |
{:else if type === "audio"}
|
| 106 |
<svelte:component
|
|
|
|
| 117 |
show_download_button={false}
|
| 118 |
display_icon_button_wrapper_top_corner={false}
|
| 119 |
minimal={true}
|
| 120 |
+
on:load={handle_load}
|
| 121 |
/>
|
| 122 |
{:else if type === "video"}
|
| 123 |
<svelte:component
|
|
|
|
| 131 |
{upload}
|
| 132 |
display_icon_button_wrapper_top_corner={false}
|
| 133 |
show_download_button={false}
|
| 134 |
+
on:load={handle_load}
|
| 135 |
>
|
| 136 |
<track kind="captions" />
|
| 137 |
</svelte:component>
|
|
|
|
| 147 |
fullscreen={image_fullscreen}
|
| 148 |
show_button_background={false}
|
| 149 |
on:fullscreen={handle_fullscreen}
|
| 150 |
+
on:load={handle_load}
|
| 151 |
{i18n}
|
| 152 |
/>
|
| 153 |
</div>
|
|
|
|
| 156 |
this={components[type]}
|
| 157 |
{...props}
|
| 158 |
props={{ value }}
|
| 159 |
+
on:load={handle_load}
|
| 160 |
/>
|
| 161 |
{:else if type === "model3d"}
|
| 162 |
<svelte:component
|
|
|
|
| 176 |
interactive={false}
|
| 177 |
show_share_button={false}
|
| 178 |
gradio={{ dispatch: () => {}, i18n }}
|
| 179 |
+
on:load={handle_load}
|
| 180 |
{i18n}
|
| 181 |
/>
|
| 182 |
{/if}
|
6.19.0/chatbot/shared/MessageContent.svelte
CHANGED
|
@@ -102,7 +102,7 @@
|
|
| 102 |
>{(file.orig_name || file.path || "")
|
| 103 |
.split(".")
|
| 104 |
.pop()
|
| 105 |
-
.toUpperCase()}</span
|
| 106 |
>
|
| 107 |
</div>
|
| 108 |
</div>
|
|
|
|
| 102 |
>{(file.orig_name || file.path || "")
|
| 103 |
.split(".")
|
| 104 |
.pop()
|
| 105 |
+
?.toUpperCase() ?? "FILE"}</span
|
| 106 |
>
|
| 107 |
</div>
|
| 108 |
</div>
|
6.19.0/chatbot/types.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
| 7 |
CopyData,
|
| 8 |
CustomButton
|
| 9 |
} from "@gradio/utils";
|
| 10 |
-
import type { LoadingStatus } from "@gradio/statustracker";
|
| 11 |
|
| 12 |
export type MessageRole = "system" | "user" | "assistant";
|
| 13 |
|
|
|
|
| 7 |
CopyData,
|
| 8 |
CustomButton
|
| 9 |
} from "@gradio/utils";
|
| 10 |
+
import type { ILoadingStatus as LoadingStatus } from "@gradio/statustracker";
|
| 11 |
|
| 12 |
export type MessageRole = "system" | "user" | "assistant";
|
| 13 |
|