Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,17 +18,8 @@ print("Your Computer IP Address is:" + IPAddr)
|
|
18 |
DESCRIPTION = """
|
19 |
# Demo: Breeze-7B-Instruct-v0.1
|
20 |
|
21 |
-
Breeze-7B is a language model family that builds on top of [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1), specifically intended for Traditional Chinese use.
|
22 |
-
|
23 |
-
[Breeze-7B-Base](https://huggingface.co/MediaTek-Research/Breeze-7B-Base-v0.1) is the base model for the Breeze-7B series.
|
24 |
-
It is suitable for use if you have substantial fine-tuning data to tune it for your specific use case.
|
25 |
-
|
26 |
-
[Breeze-7B-Instruct](https://huggingface.co/MediaTek-Research/Breeze-7B-Instruct-v0.1) derives from the base model Breeze-7B-Base, making the resulting model amenable to be used as-is for commonly seen tasks.
|
27 |
-
|
28 |
-
[Breeze-7B-Instruct-64k](https://huggingface.co/MediaTek-Research/Breeze-7B-Instruct-64k-v0.1) is a slightly modified version of
|
29 |
-
Breeze-7B-Instruct to enable a 64k-token context length. Roughly speaking, that is equivalent to 88k Traditional Chinese characters.
|
30 |
-
|
31 |
-
The current release version of Breeze-7B is v0.1.
|
32 |
|
33 |
*A project by the members (in alphabetical order): Chan-Jan Hsu 許湛然, Chang-Le Liu 劉昶樂, Feng-Ting Liao 廖峰挺, Po-Chun Hsu 許博竣, Yi-Chang Chen 陳宜昌, and the supervisor Da-Shan Shiu 許大山.*
|
34 |
|
@@ -104,30 +95,12 @@ def refusal_condition(query):
|
|
104 |
with gr.Blocks() as demo:
|
105 |
gr.Markdown(DESCRIPTION)
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
show_label=False,
|
112 |
-
placeholder='Type a message...',
|
113 |
-
scale=10,
|
114 |
-
)
|
115 |
-
submit_button = gr.Button('Submit',
|
116 |
-
variant='primary',
|
117 |
-
scale=1,
|
118 |
-
min_width=0)
|
119 |
-
|
120 |
-
with gr.Row():
|
121 |
-
retry_button = gr.Button('🔄 Retry', variant='secondary')
|
122 |
-
undo_button = gr.Button('↩️ Undo', variant='secondary')
|
123 |
-
clear = gr.Button('🗑️ Clear', variant='secondary')
|
124 |
-
|
125 |
-
saved_input = gr.State()
|
126 |
-
|
127 |
with gr.Accordion(label='Advanced options', open=False):
|
128 |
-
|
129 |
-
value=DEFAULT_SYSTEM_PROMPT,
|
130 |
-
lines=6)
|
131 |
max_new_tokens = gr.Slider(
|
132 |
label='Max new tokens',
|
133 |
minimum=32,
|
@@ -150,6 +123,27 @@ with gr.Blocks() as demo:
|
|
150 |
value=0.01,
|
151 |
)
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
def user(user_message, history):
|
155 |
return "", history + [[user_message, None]]
|
|
|
18 |
DESCRIPTION = """
|
19 |
# Demo: Breeze-7B-Instruct-v0.1
|
20 |
|
21 |
+
Breeze-7B is a language model family that builds on top of [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1), specifically intended for Traditional Chinese use.
|
22 |
+
[Breeze-7B-Instruct-v0_1](https://huggingface.co/MediaTek-Research/Breeze-7B-Instruct-v0_1) demonstrates impressive performance in benchmarks for Traditional Chinese and English, when compared to similar sized open-source contemporaries such as Taiwan-LLM-7B/13B-chat, QWen-7B-Chat, and Yi-6B-Chat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
*A project by the members (in alphabetical order): Chan-Jan Hsu 許湛然, Chang-Le Liu 劉昶樂, Feng-Ting Liao 廖峰挺, Po-Chun Hsu 許博竣, Yi-Chang Chen 陳宜昌, and the supervisor Da-Shan Shiu 許大山.*
|
25 |
|
|
|
95 |
with gr.Blocks() as demo:
|
96 |
gr.Markdown(DESCRIPTION)
|
97 |
|
98 |
+
system_prompt = gr.Textbox(label='System prompt',
|
99 |
+
value=DEFAULT_SYSTEM_PROMPT,
|
100 |
+
lines=1)
|
101 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
with gr.Accordion(label='Advanced options', open=False):
|
103 |
+
|
|
|
|
|
104 |
max_new_tokens = gr.Slider(
|
105 |
label='Max new tokens',
|
106 |
minimum=32,
|
|
|
123 |
value=0.01,
|
124 |
)
|
125 |
|
126 |
+
chatbot = gr.Chatbot()
|
127 |
+
with gr.Row():
|
128 |
+
msg = gr.Textbox(
|
129 |
+
container=False,
|
130 |
+
show_label=False,
|
131 |
+
placeholder='Type a message...',
|
132 |
+
scale=10,
|
133 |
+
lines=6
|
134 |
+
)
|
135 |
+
submit_button = gr.Button('Submit',
|
136 |
+
variant='primary',
|
137 |
+
scale=1,
|
138 |
+
min_width=0)
|
139 |
+
|
140 |
+
with gr.Row():
|
141 |
+
retry_button = gr.Button('🔄 Retry', variant='secondary')
|
142 |
+
undo_button = gr.Button('↩️ Undo', variant='secondary')
|
143 |
+
clear = gr.Button('🗑️ Clear', variant='secondary')
|
144 |
+
|
145 |
+
saved_input = gr.State()
|
146 |
+
|
147 |
|
148 |
def user(user_message, history):
|
149 |
return "", history + [[user_message, None]]
|