Skip to content

Commit

Permalink
Fixed the avatar of the box by using a local file (#1266)
Browse files Browse the repository at this point in the history
Now rendering a specific file inside the python code
  • Loading branch information
lopagela authored Nov 18, 2023
1 parent 0d52002 commit f7d7b6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Binary file added private_gpt/ui/avatar-bot.ico
Binary file not shown.
10 changes: 7 additions & 3 deletions private_gpt/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from llama_index.llms import ChatMessage, ChatResponse, MessageRole
from pydantic import BaseModel

from private_gpt.constants import PROJECT_ROOT_PATH
from private_gpt.di import global_injector
from private_gpt.server.chat.chat_service import ChatService, CompletionGen
from private_gpt.server.chunks.chunks_service import Chunk, ChunksService
Expand All @@ -21,7 +22,12 @@

logger = logging.getLogger(__name__)

THIS_DIRECTORY_RELATIVE = Path(__file__).parent.relative_to(PROJECT_ROOT_PATH)
# Should be "private_gpt/ui/avatar-bot.ico"
AVATAR_BOT = THIS_DIRECTORY_RELATIVE / "avatar-bot.ico"

UI_TAB_TITLE = "My Private GPT"

SOURCES_SEPARATOR = "\n\n Sources: \n"


Expand Down Expand Up @@ -211,9 +217,7 @@ def _build_ui_blocks(self) -> gr.Blocks:
render=False,
avatar_images=(
None,
"https://lh3.googleusercontent.com/drive-viewer/AK7aPa"
"AicXck0k68nsscyfKrb18o9ak3BSaWM_Qzm338cKoQlw72Bp0UKN84"
"IFZjXjZApY01mtnUXDeL4qzwhkALoe_53AhwCg=s2560",
AVATAR_BOT,
),
),
additional_inputs=[mode, upload_button],
Expand Down

0 comments on commit f7d7b6c

Please sign in to comment.