Skip to content

Commit ca02992

Browse files
committed
Add custom image as an avatar for bot
* Upgrade the streamlit version from 1.22.0 to 1.26.0 Reference: 1. AI-Yash/st-chat#34 2. https://docs.streamlit.io/library/advanced-features/static-file-serving 3. [If the image not found in cloud](https://discuss.streamlit.io/t/streamlit-chat-avatars-not-working-on-cloud/46713)
1 parent 8fd68f8 commit ca02992

12 files changed

+13
-11
lines changed

.streamlit/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[server]
2+
enableStaticServing = true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img style="width: 50%; height: auto;" src="./img/repos_logo.png" alt="Chatbot Image">
2+
<img style="width: 50%; height: auto;" src="./static/img/repos_logo.png" alt="Chatbot Image">
33
</p>
44

55

@@ -40,7 +40,7 @@ If you like this project, please give it a ⭐`Star` to support the developers~
4040
- `openai`: Offers stable access by using an API key.
4141

4242
<p align="center">
43-
<img src="img/2023-08-29-13-39-00.png" width="70%">
43+
<img src="static/img/2023-08-29-13-39-00.png" width="70%">
4444
</p>
4545

4646
---
@@ -119,7 +119,7 @@ Through LangChain, you can create a universal AI model or tailor it for business
119119

120120
4. 🚀Start asking questions!
121121

122-
![docGPT](https://github.com/Lin-jun-xiang/docGPT-streamlit/blob/main/img/docGPT.gif?raw=true)
122+
![docGPT](https://github.com/Lin-jun-xiang/docGPT-streamlit/blob/main/static/img/docGPT.gif?raw=true)
123123

124124
---
125125

README.zh-TW.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img style="width: 50%; height: auto;" src="./img/repos_logo.png" alt="Chatbot Image">
2+
<img style="width: 50%; height: auto;" src="./static/img/repos_logo.png" alt="Chatbot Image">
33
</p>
44

55
[English](./README.md) | [中文版](./README.zh-TW.md)
@@ -42,7 +42,7 @@
4242
* `openai`: 通過 API 金鑰穩定調用 `openai` 模型
4343

4444
<p align="center">
45-
<img src="img/2023-08-29-13-39-00.png" width="70%">
45+
<img src="static/img/2023-08-29-13-39-00.png" width="70%">
4646
</p>
4747

4848
---
@@ -122,7 +122,7 @@ LangChain 填補了 ChatGPT 的不足之處。通過以下示例,您可以理
122122

123123
4. 🚀開始提問 !
124124

125-
![RGB_cleanup](https://github.com/Lin-jun-xiang/docGPT-streamlit/blob/main/img/docGPT.gif?raw=true)
125+
![RGB_cleanup](https://github.com/Lin-jun-xiang/docGPT-streamlit/blob/main/static/img/docGPT.gif?raw=true)
126126

127127
---
128128

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
def theme() -> None:
3030
st.set_page_config(page_title="Document GPT")
31-
st.image('./img/repos_logo.png', width=250)
31+
st.image('./static/img/repos_logo.png', width=250)
3232

3333
with st.sidebar:
3434

@@ -181,9 +181,9 @@ def get_response(query: str) -> str:
181181
message(
182182
st.session_state["response"][i], key=str(i),
183183
logo=(
184-
'https://api.dicebear.com/6.x/bottts/svg?'
185-
'baseColor=fb8c00&eyes=bulging'
186-
)
184+
'https://github.com/Lin-jun-xiang/docGPT-streamlit/'
185+
'blob/main/static/img/chatbot_v2.png?raw=true'
186+
)
187187
)
188188
message(
189189
st.session_state['query'][i], is_user=True, key=str(i) + '_user',

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
g4f==0.0.2.2
22
langchain==0.0.218
33
openai==0.27.8
4-
streamlit==1.22.0
4+
streamlit==1.26.0
55
streamlit_chat==0.1.1
66
pymupdf==1.22.5
77
faiss-cpu==1.7.4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)