Skip to content

Commit 3bf2e9d

Browse files
authored
fix(ui): not all models have an Icon (mudler#4913)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 1461fd8 commit 3bf2e9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/http/views/chat.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h2 class="text-lg font-semibold">Chat Settings</h2>
9494
<!-- Model info -->
9595
<div class="space-y-2">
9696
<div class="flex items-center">
97-
<img src="{{$galleryConfig.Icon}}" class="rounded-lg w-8 h-8 mr-2">
97+
{{ if $galleryConfig.Icon }}<img src="{{$galleryConfig.Icon}}" class="rounded-lg w-8 h-8 mr-2">{{end}}
9898
<h3 class="text-md font-medium">{{ $model }}</h3>
9999
</div>
100100
<button data-twe-ripple-init data-twe-ripple-color="light" class="w-full text-left flex items-center px-3 py-2 text-xs rounded text-white bg-gray-700 hover:bg-gray-600 transition-colors" data-modal-target="model-info-modal" data-modal-toggle="model-info-modal">
@@ -229,7 +229,7 @@ <h3 class="text-md font-medium">{{ $model }}</h3>
229229
<i class="fa-solid fa-comments mr-2"></i>
230230
{{ if $model }}
231231
{{ $galleryConfig:= index $allGalleryConfigs $model}}
232-
<img src="{{$galleryConfig.Icon}}" class="rounded-lg w-8 h-8 mr-2">
232+
{{ if $galleryConfig.Icon }}<img src="{{$galleryConfig.Icon}}" class="rounded-lg w-8 h-8 mr-2">{{end}}
233233
{{ end }}
234234
<h1 class="text-lg font-semibold">
235235
Chat {{ if .Model }} with {{.Model}} {{ end }}
@@ -262,7 +262,7 @@ <h1 class="text-lg font-semibold">
262262
</template>
263263
<template x-if="message.role != 'user'">
264264
<div class="flex items-center space-x-2">
265-
<img src="{{$galleryConfig.Icon}}" class="rounded-lg mt-2 max-w-8 max-h-8">
265+
{{ if $galleryConfig.Icon }}<img src="{{$galleryConfig.Icon}}" class="rounded-lg mt-2 max-w-8 max-h-8">{{end}}
266266
<div class="flex flex-col flex-1">
267267
<span class="text-xs font-semibold text-gray-400">{{if .Model}}{{.Model}}{{else}}Assistant{{end}}</span>
268268
<div class="flex-1 text-white flex items-center space-x-2">
@@ -355,7 +355,7 @@ <h3 class="text-xl font-semibold text-gray-900 dark:text-white">{{ $model }}</h3
355355
<!-- Body -->
356356
<div class="p-4 md:p-5 space-y-4">
357357
<div class="flex justify-center items-center">
358-
<img class="lazy rounded-t-lg max-h-48 max-w-96 object-cover mt-3 entered loaded" src="{{$galleryConfig.Icon}}" loading="lazy"/>
358+
{{ if $galleryConfig.Icon }}<img class="lazy rounded-t-lg max-h-48 max-w-96 object-cover mt-3 entered loaded" src="{{$galleryConfig.Icon}}" loading="lazy"/>{{end}}
359359
</div>
360360
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">{{ $galleryConfig.Description }}</p>
361361
<hr>

0 commit comments

Comments
 (0)