From f7d7b6cd4ba9da239b81baa2bb6cf63e08bad704 Mon Sep 17 00:00:00 2001 From: lopagela Date: Sat, 18 Nov 2023 12:29:27 +0100 Subject: [PATCH] Fixed the avatar of the box by using a local file (#1266) Now rendering a specific file inside the python code --- private_gpt/ui/avatar-bot.ico | Bin 0 -> 15406 bytes private_gpt/ui/ui.py | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 private_gpt/ui/avatar-bot.ico diff --git a/private_gpt/ui/avatar-bot.ico b/private_gpt/ui/avatar-bot.ico new file mode 100644 index 0000000000000000000000000000000000000000..ab220adb2ff076d74bac45104f3c068b85e7aecd GIT binary patch literal 15406 zcmeI33yfS<8OQJJZhe9l++}C(z4O|cotYg=yL3^ppo~OOV-X@WjhG56h&5IlEFnRR zU4k)2NE=j2Y=SmXtE42RK2pG{MM~RPL_%w=VrjOewbfRzExKE}tiS)AduQ&>&dknq zx(%AU$?3Us9^d1CzVn@PzH@3AA*0=xIny9d7>hd$sF9|MkC6BMKA>g^pg!`b;hyPWanXHa~6Kms3`cPFuz_m-m|H$&6(! z^ZE}NMjK_1k&cqy@0C~P^qJEeiJVY>_$~J8^ZESiC|jG3M8-+aW;;92_3He2uWf%r zZPa#w!Jzy8Qr+Dbq)l@l^r6`&pzAkO_}CGc<+&H5=t@pD%-_>=_064tcw%2&%neU^2}9NV_)(UT8kJuBdsY}&QeYujiYu5l)Q z_bd3l-K4?FHONn=Hx}!m%~pKl!?{>&fVx(&2*I}#dS7R4_^0EqP4l6gWxdVM)Bnv{ zbA#H#{}s|E`pi9D8PNL;(EB3vUWAU;4XwfZv$j1Onv?9Hp!TM@hIXgiwkOFq2ot}I zjea}(2GjhDXn6_#2YaK@_l}Q`PvW1+WQ5g^ql8BGr8TEfzG~;}O>A4Z|Hnt` z@6cWF@e(dfmrd7M64TZ@=QB0DJStJbGhSvHx>!u$6nI>^EPWkmyew5KfV z3i=)L_(Nv|T&{0sUShjf32PsXeOmu($?GqdeKP;PU+T-=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#_3Lm3Vt?Rd)!vf2_UunLIa^1TTMtWS8>!*y#%7-wEFd`)XwI z&njfoh0eq_;&Jp zI8QRgop&_TF1x3V^QMy+Ciq{8>?@fUoB7s0{xH9_xA63F<~F~NlceV!+G)S6H!)W! zHsH$ckv^MwsDN+PI|c0{*^AxGTCfV)HX`RvY;3O*-@C|viEgWP=9Mp&++fh~+q3Cb zO5-6Po5V-;#^Zh1)*SrRT&2AJj{t8SowGFWG35uQTb_V^fIxsifIxsifIxsifIu|_ F{tMXj*>eB@ literal 0 HcmV?d00001 diff --git a/private_gpt/ui/ui.py b/private_gpt/ui/ui.py index dea99f50e..eb5c11707 100644 --- a/private_gpt/ui/ui.py +++ b/private_gpt/ui/ui.py @@ -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 @@ -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" @@ -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],