Skip to content

Commit

Permalink
refac
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jul 9, 2024
1 parent aa896ba commit c9f5029
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/apps/webui/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ModelParams(BaseModel):

# ModelMeta is a model for the data stored in the meta field of the Model table
class ModelMeta(BaseModel):
profile_image_url: Optional[str] = "/favicon.png"
profile_image_url: Optional[str] = "/static/favicon.png"

description: Optional[str] = None
"""
Expand Down
2 changes: 1 addition & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ async def get_opensearch_xml():
<ShortName>{WEBUI_NAME}</ShortName>
<Description>Search {WEBUI_NAME}</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">{WEBUI_URL}/favicon.png</Image>
<Image width="16" height="16" type="image/x-icon">{WEBUI_URL}/static/favicon.png</Image>
<Url type="text/html" method="get" template="{WEBUI_URL}/?q={"{searchTerms}"}"/>
<moz:SearchForm>{WEBUI_URL}</moz:SearchForm>
</OpenSearchDescription>
Expand Down
2 changes: 1 addition & 1 deletion backend/test/apps/webui/routers/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_models(self):
"base_model_id": "base-model-id",
"name": "Hello World",
"meta": {
"profile_image_url": "/favicon.png",
"profile_image_url": "/static/favicon.png",
"description": "description",
"capabilities": None,
"model_config": {},
Expand Down
10 changes: 6 additions & 4 deletions src/lib/components/chat/MessageInput/CallOverlay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,11 @@
: rmsLevel * 100 > 1
? 'size-14'
: 'size-12'} transition-all rounded-full {(model?.info?.meta
?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png'
? ' bg-cover bg-center bg-no-repeat'
: 'bg-black dark:bg-white'} bg-black dark:bg-white"
style={(model?.info?.meta?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
style={(model?.info?.meta?.profile_image_url ?? '/static/favicon.png') !==
'/static/favicon.png'
? `background-image: url('${model?.info?.meta?.profile_image_url}');`
: ''}
/>
Expand Down Expand Up @@ -743,10 +744,11 @@
: rmsLevel * 100 > 1
? 'size-[11.5rem]'
: 'size-44'} transition-all rounded-full {(model?.info?.meta
?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png'
? ' bg-cover bg-center bg-no-repeat'
: 'bg-black dark:bg-white'} "
style={(model?.info?.meta?.profile_image_url ?? '/favicon.png') !== '/favicon.png'
style={(model?.info?.meta?.profile_image_url ?? '/static/favicon.png') !==
'/static/favicon.png'
? `background-image: url('${model?.info?.meta?.profile_image_url}');`
: ''}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/workspace/Models.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
: ''} "
>
<img
src={model?.info?.meta?.profile_image_url ?? '/favicon.png'}
src={model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
alt="modelfile profile"
class=" rounded-full w-full h-auto object-cover"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/workspace/models/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
...info,
meta: {
...info.meta,
profile_image_url: info.meta.profile_image_url ?? '/favicon.png',
profile_image_url: info.meta.profile_image_url ?? '/static/favicon.png',
suggestion_prompts: info.meta.suggestion_prompts
? info.meta.suggestion_prompts.filter((prompt) => prompt.content !== '')
: null
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/workspace/models/edit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
base_model_id: null,
name: '',
meta: {
profile_image_url: '/favicon.png',
profile_image_url: '/static/favicon.png',
description: '',
suggestion_prompts: null,
tags: []
Expand Down
Binary file added static/static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c9f5029

Please sign in to comment.