nsarrazin HF Staff commited on
Commit
ca43db4
·
1 Parent(s): 468c9ce

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
- {#if modelIsMultimodal || modelHasTools}
218
- {@const mimeTypesString = mimeTypes
219
- .map((m) => {
220
- // if the mime type ends in *, grab the first part so image/* becomes image
221
- if (m.endsWith("*")) {
222
- return m.split("/")[0];
223
- }
224
- // otherwise, return the second part for example application/pdf becomes pdf
225
- return m.split("/")[1];
226
- })
227
- .join(", ")}
228
- <form class="flex items-center">
229
- <HoverTooltip
230
- label={`Upload ${mimeTypesString} files`}
231
- position="top"
232
- TooltipClassNames="text-xs !text-left !w-auto whitespace-nowrap !py-1 !mb-0 max-sm:hidden"
233
- >
234
- <label class="base-tool relative" class:active-tool={documentParserIsOn}>
235
- <input
236
- disabled={loading}
237
- class="absolute hidden size-0"
238
- aria-label="Upload file"
239
- type="file"
240
- on:change={onFileChange}
241
- accept={mimeTypes.join(",")}
242
- />
243
- <IconPaperclip classNames="text-xl" />
244
- {#if documentParserIsOn}
245
- Document Parser
246
- {/if}
247
- </label>
248
- </HoverTooltip>
249
- </form>
250
- {/if}
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}