Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: bring back file upload for multimodal models
Browse files
src/lib/components/chat/ChatInput.svelte
CHANGED
@@ -214,40 +214,40 @@
|
|
214 |
{/if}
|
215 |
</button>
|
216 |
</HoverTooltip>
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
</
|
249 |
-
</
|
250 |
-
|
251 |
{/if}
|
252 |
{#if modelHasTools}
|
253 |
{#each extraTools as tool}
|
|
|
214 |
{/if}
|
215 |
</button>
|
216 |
</HoverTooltip>
|
217 |
+
{/if}
|
218 |
+
{#if modelIsMultimodal || modelHasTools}
|
219 |
+
{@const mimeTypesString = mimeTypes
|
220 |
+
.map((m) => {
|
221 |
+
// if the mime type ends in *, grab the first part so image/* becomes image
|
222 |
+
if (m.endsWith("*")) {
|
223 |
+
return m.split("/")[0];
|
224 |
+
}
|
225 |
+
// otherwise, return the second part for example application/pdf becomes pdf
|
226 |
+
return m.split("/")[1];
|
227 |
+
})
|
228 |
+
.join(", ")}
|
229 |
+
<form class="flex items-center">
|
230 |
+
<HoverTooltip
|
231 |
+
label={`Upload ${mimeTypesString} files`}
|
232 |
+
position="top"
|
233 |
+
TooltipClassNames="text-xs !text-left !w-auto whitespace-nowrap !py-1 !mb-0 max-sm:hidden"
|
234 |
+
>
|
235 |
+
<label class="base-tool relative" class:active-tool={documentParserIsOn}>
|
236 |
+
<input
|
237 |
+
disabled={loading}
|
238 |
+
class="absolute hidden size-0"
|
239 |
+
aria-label="Upload file"
|
240 |
+
type="file"
|
241 |
+
on:change={onFileChange}
|
242 |
+
accept={mimeTypes.join(",")}
|
243 |
+
/>
|
244 |
+
<IconPaperclip classNames="text-xl" />
|
245 |
+
{#if documentParserIsOn}
|
246 |
+
Document Parser
|
247 |
+
{/if}
|
248 |
+
</label>
|
249 |
+
</HoverTooltip>
|
250 |
+
</form>
|
251 |
{/if}
|
252 |
{#if modelHasTools}
|
253 |
{#each extraTools as tool}
|