Spaces:
Sleeping
Sleeping
NGUYEN, Xuan Phi
commited on
Commit
•
05b693f
1
Parent(s):
c1519e7
update
Browse files- app.py +1 -9
- multipurpose_chatbot/configs.py +79 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -49,6 +49,7 @@ from multipurpose_chatbot.configs import (
|
|
49 |
BACKEND,
|
50 |
DEMOS,
|
51 |
DELETE_FOLDER,
|
|
|
52 |
)
|
53 |
|
54 |
|
@@ -72,15 +73,6 @@ if DELETE_FOLDER is not None and os.path.exists(DELETE_FOLDER):
|
|
72 |
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
73 |
|
74 |
|
75 |
-
CSS = """
|
76 |
-
.message-wrap.svelte-1lcyrx4>div.svelte-1lcyrx4 img {
|
77 |
-
min-width: 200px;
|
78 |
-
}
|
79 |
-
.panel-full-width.svelte-1lcyrx4.svelte-1lcyrx4.svelte-1lcyrx4 {
|
80 |
-
padding: calc(var(--spacing-xxl) * 1);
|
81 |
-
width: 100%
|
82 |
-
}
|
83 |
-
"""
|
84 |
|
85 |
|
86 |
def launch_demo():
|
|
|
49 |
BACKEND,
|
50 |
DEMOS,
|
51 |
DELETE_FOLDER,
|
52 |
+
CSS,
|
53 |
)
|
54 |
|
55 |
|
|
|
73 |
print('Failed to delete %s. Reason: %s' % (file_path, e))
|
74 |
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
|
78 |
def launch_demo():
|
multipurpose_chatbot/configs.py
CHANGED
@@ -47,6 +47,45 @@ The service collects user dialogue data for testing and improvement under
|
|
47 |
"""
|
48 |
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
# MODEL_INFO = """
|
51 |
# <h4 style="display: hidden;">Model Name: {model_path}</h4>
|
52 |
# """
|
@@ -64,6 +103,46 @@ If you find our project useful, hope you can star our repo and cite our paper as
|
|
64 |
```
|
65 |
|
66 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
USE_PANEL = bool(int(os.environ.get("USE_PANEL", "1")))
|
68 |
CHATBOT_HEIGHT = int(os.environ.get("CHATBOT_HEIGHT", "500"))
|
69 |
|
|
|
47 |
"""
|
48 |
|
49 |
|
50 |
+
|
51 |
+
MODEL_TITLE = """
|
52 |
+
<img src="file/seal_logo.png" style="
|
53 |
+
max-width: 10em;
|
54 |
+
max-height: 5%;
|
55 |
+
height: 3em;
|
56 |
+
width: 3em;
|
57 |
+
">
|
58 |
+
<div class="text" style="
|
59 |
+
float: left;
|
60 |
+
padding-left: 2%;
|
61 |
+
font-size: larger;
|
62 |
+
margin-bottom: -1em;
|
63 |
+
margin-top: -1em;
|
64 |
+
">
|
65 |
+
SeaLLMs - Large Language Models for Southeast Asia
|
66 |
+
<div style='display:flex; gap: 0.25rem; '>
|
67 |
+
<a href='https://damo-nlp-sg.github.io/SeaLLMs/'><img class="tag" src='https://img.shields.io/badge/Blog-red'></a>
|
68 |
+
<a href='https://github.com/damo-nlp-sg/seallms'><img class="tag" src='https://img.shields.io/badge/Code-success'></a>
|
69 |
+
<a href='https://huggingface.co/spaces/SeaLLMs/SeaLLM-7B'><img class="tag" src='https://img.shields.io/badge/%F0%9F%A4%97-Spaces-blue'></a>
|
70 |
+
<a href='https://huggingface.co/SeaLLMs/SeaLMMM-7B-v0.1'><img class="tag" src='https://img.shields.io/badge/%F0%9F%A4%97-Model-blue'></a>
|
71 |
+
<a href='https://arxiv.org/pdf/2312.00738.pdf'><img class="tag" src='https://img.shields.io/badge/Paper-red'></a>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
"""
|
75 |
+
MODEL_DESC = f"""
|
76 |
+
<span style="font-size: large">
|
77 |
+
<a href="https://huggingface.co/SeaLLMs/SeaLMMM-7B-v0.1" target="_blank">SeaLMMM-7B</a> - multilingual multimodal assistant for Southeast Asia. It handles <b>both</b> text-only (<a href="https://huggingface.co/SeaLLMs/SeaLLM-7B-v2.5" target="_blank">LLMs</a> and vision instructions (LVMs). <span style="color: red">SeaLMMM-7B has not finished training.</span>
|
78 |
+
</span>
|
79 |
+
<br>
|
80 |
+
<span style="font-size: small">
|
81 |
+
This UI is powered by <a href="https://github.com/DAMO-NLP-SG/Multipurpose-Chatbot" target="_blank">Multipurpose-Chatbot</a> project.
|
82 |
+
<span style="color: red">The chatbot may produce false and harmful content!
|
83 |
+
By using our service, you agree to our <a href="https://huggingface.co/SeaLLMs/SeaLLM-Chat-13b/blob/main/LICENSE" target="_blank">Terms Of Use</a>
|
84 |
+
</span>
|
85 |
+
</span>
|
86 |
+
""".strip()
|
87 |
+
|
88 |
+
|
89 |
# MODEL_INFO = """
|
90 |
# <h4 style="display: hidden;">Model Name: {model_path}</h4>
|
91 |
# """
|
|
|
103 |
```
|
104 |
|
105 |
"""
|
106 |
+
|
107 |
+
CSS = """
|
108 |
+
.message-wrap.svelte-1lcyrx4>div.svelte-1lcyrx4 img {
|
109 |
+
min-width: 200px;
|
110 |
+
min-height: 150px;
|
111 |
+
max-height: 600px;
|
112 |
+
max-width; 90%;
|
113 |
+
width: auto;
|
114 |
+
object-fit: contain;
|
115 |
+
}
|
116 |
+
.panel-full-width.svelte-1lcyrx4.svelte-1lcyrx4.svelte-1lcyrx4 {
|
117 |
+
padding: calc(var(--spacing-xxl) * 1);
|
118 |
+
width: 100%
|
119 |
+
}
|
120 |
+
|
121 |
+
.panel-full-width {
|
122 |
+
padding: calc(var(--spacing-xxl) * 1);
|
123 |
+
width: 100%
|
124 |
+
}
|
125 |
+
|
126 |
+
img.tag {
|
127 |
+
max-height: 1.5em;
|
128 |
+
width: auto;
|
129 |
+
}
|
130 |
+
|
131 |
+
span.prose {
|
132 |
+
font-size: var(--text-lg);
|
133 |
+
}
|
134 |
+
"""
|
135 |
+
|
136 |
+
# .message-wrap.svelte-1lcyrx4>div.svelte-1lcyrx4 img {
|
137 |
+
# min-width: 200px;
|
138 |
+
# }
|
139 |
+
# .panel-full-width.svelte-1lcyrx4.svelte-1lcyrx4.svelte-1lcyrx4 {
|
140 |
+
# padding: calc(var(--spacing-xxl) * 1);
|
141 |
+
# width: 100%
|
142 |
+
# }
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
USE_PANEL = bool(int(os.environ.get("USE_PANEL", "1")))
|
147 |
CHATBOT_HEIGHT = int(os.environ.get("CHATBOT_HEIGHT", "500"))
|
148 |
|
requirements.txt
CHANGED
@@ -2,7 +2,7 @@ torch
|
|
2 |
gradio
|
3 |
tiktoken
|
4 |
openai
|
5 |
-
transformers==4.
|
6 |
langchain
|
7 |
langchain-community
|
8 |
langchain-core
|
|
|
2 |
gradio
|
3 |
tiktoken
|
4 |
openai
|
5 |
+
transformers==4.40
|
6 |
langchain
|
7 |
langchain-community
|
8 |
langchain-core
|