Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,12 +30,12 @@ import spaces
|
|
| 30 |
|
| 31 |
|
| 32 |
MODEL_NAME_MAP = {
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"1.
|
| 37 |
-
"3.
|
| 38 |
-
"
|
| 39 |
}
|
| 40 |
|
| 41 |
quantization_config = BitsAndBytesConfig(
|
|
@@ -177,7 +177,7 @@ def demo():
|
|
| 177 |
"""
|
| 178 |
)
|
| 179 |
|
| 180 |
-
|
| 181 |
|
| 182 |
chat_history = gr.Chatbot(value=[])
|
| 183 |
|
|
@@ -203,7 +203,7 @@ def demo():
|
|
| 203 |
with gr.Accordion(label="詳細設定", open=False):
|
| 204 |
system_prompt_text = gr.Textbox(
|
| 205 |
label="システムプロンプト",
|
| 206 |
-
value="
|
| 207 |
)
|
| 208 |
max_new_tokens_slider = gr.Slider(
|
| 209 |
minimum=1, maximum=2048, value=256, step=1, label="Max new tokens"
|
|
@@ -235,7 +235,7 @@ def demo():
|
|
| 235 |
triggers=[start_btn.click, input_text.submit],
|
| 236 |
fn=respond,
|
| 237 |
inputs=[
|
| 238 |
-
|
| 239 |
input_text,
|
| 240 |
chat_history,
|
| 241 |
system_prompt_text,
|
|
@@ -249,7 +249,7 @@ def demo():
|
|
| 249 |
retry_btn.click(
|
| 250 |
retry,
|
| 251 |
inputs=[
|
| 252 |
-
|
| 253 |
chat_history,
|
| 254 |
system_prompt_text,
|
| 255 |
max_new_tokens_slider,
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
MODEL_NAME_MAP = {
|
| 33 |
+
"150M": "llm-jp/llm-jp-3-150m-instruct3",
|
| 34 |
+
"440M": "llm-jp/llm-jp-3-440m-instruct3",
|
| 35 |
+
"980M": "llm-jp/llm-jp-3-980m-instruct3",
|
| 36 |
+
"1.8B": "llm-jp/llm-jp-3-1.8b-instruct3",
|
| 37 |
+
"3.7B": "llm-jp/llm-jp-3-3.7b-instruct3",
|
| 38 |
+
"13B": "llm-jp/llm-jp-3-13b-instruct3",
|
| 39 |
}
|
| 40 |
|
| 41 |
quantization_config = BitsAndBytesConfig(
|
|
|
|
| 177 |
"""
|
| 178 |
)
|
| 179 |
|
| 180 |
+
model_name_radio = gr.Radio(label="モデル", choices=list(MODELS.keys()), value=list(MODELS.keys())[0])
|
| 181 |
|
| 182 |
chat_history = gr.Chatbot(value=[])
|
| 183 |
|
|
|
|
| 203 |
with gr.Accordion(label="詳細設定", open=False):
|
| 204 |
system_prompt_text = gr.Textbox(
|
| 205 |
label="システムプロンプト",
|
| 206 |
+
value="以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。",
|
| 207 |
)
|
| 208 |
max_new_tokens_slider = gr.Slider(
|
| 209 |
minimum=1, maximum=2048, value=256, step=1, label="Max new tokens"
|
|
|
|
| 235 |
triggers=[start_btn.click, input_text.submit],
|
| 236 |
fn=respond,
|
| 237 |
inputs=[
|
| 238 |
+
model_name_radio,
|
| 239 |
input_text,
|
| 240 |
chat_history,
|
| 241 |
system_prompt_text,
|
|
|
|
| 249 |
retry_btn.click(
|
| 250 |
retry,
|
| 251 |
inputs=[
|
| 252 |
+
model_name_radio,
|
| 253 |
chat_history,
|
| 254 |
system_prompt_text,
|
| 255 |
max_new_tokens_slider,
|