Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,9 @@ MODEL_NAME_MAP = {
|
|
| 37 |
"150m-instruct3": "llm-jp/llm-jp-3-150m-instruct3",
|
| 38 |
"440m-instruct3": "llm-jp/llm-jp-3-440m-instruct3",
|
| 39 |
"980m-instruct3": "llm-jp/llm-jp-3-980m-instruct3",
|
| 40 |
-
"1.8b-instruct3": "llm-jp/llm-jp-3-1.8b-instruct3",
|
| 41 |
-
"3.7b-instruct3": "llm-jp/llm-jp-3-3.7b-instruct3",
|
| 42 |
-
"13b-instruct3": "llm-jp/llm-jp-3-13b-instruct3",
|
| 43 |
}
|
| 44 |
|
| 45 |
quantization_config = BitsAndBytesConfig(
|
|
@@ -50,11 +50,11 @@ quantization_config = BitsAndBytesConfig(
|
|
| 50 |
)
|
| 51 |
MODELS = {
|
| 52 |
key: AutoModelForCausalLM.from_pretrained(
|
| 53 |
-
|
| 54 |
-
) for key,
|
| 55 |
}
|
| 56 |
TOKENIZERS = {
|
| 57 |
-
key: AutoTokenizer.from_pretrained(
|
| 58 |
|
| 59 |
}
|
| 60 |
|
|
@@ -189,21 +189,17 @@ def demo():
|
|
| 189 |
components=[chat_history], value="🗑️ 削除", scale=1,
|
| 190 |
)
|
| 191 |
|
| 192 |
-
with gr.
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
scale=2,
|
| 204 |
-
)
|
| 205 |
-
gr.Markdown(
|
| 206 |
-
value="※ 誤った情報を生成する可能性があります。"
|
| 207 |
)
|
| 208 |
|
| 209 |
with gr.Accordion(label="詳細設定", open=False):
|
|
|
|
| 37 |
"150m-instruct3": "llm-jp/llm-jp-3-150m-instruct3",
|
| 38 |
"440m-instruct3": "llm-jp/llm-jp-3-440m-instruct3",
|
| 39 |
"980m-instruct3": "llm-jp/llm-jp-3-980m-instruct3",
|
| 40 |
+
# "1.8b-instruct3": "llm-jp/llm-jp-3-1.8b-instruct3",
|
| 41 |
+
# "3.7b-instruct3": "llm-jp/llm-jp-3-3.7b-instruct3",
|
| 42 |
+
# "13b-instruct3": "llm-jp/llm-jp-3-13b-instruct3",
|
| 43 |
}
|
| 44 |
|
| 45 |
quantization_config = BitsAndBytesConfig(
|
|
|
|
| 50 |
)
|
| 51 |
MODELS = {
|
| 52 |
key: AutoModelForCausalLM.from_pretrained(
|
| 53 |
+
repo_id, quantization_config=quantization_config, device_map="auto"
|
| 54 |
+
) for key, repo_id in MODEL_NAME_MAP.items()
|
| 55 |
}
|
| 56 |
TOKENIZERS = {
|
| 57 |
+
key: AutoTokenizer.from_pretrained(repo_id) for key, repo_id in MODEL_NAME_MAP.items()
|
| 58 |
|
| 59 |
}
|
| 60 |
|
|
|
|
| 189 |
components=[chat_history], value="🗑️ 削除", scale=1,
|
| 190 |
)
|
| 191 |
|
| 192 |
+
with gr.Row():
|
| 193 |
+
input_text = gr.Textbox(
|
| 194 |
+
value="",
|
| 195 |
+
placeholder="質問を入力してください...",
|
| 196 |
+
show_label=False,
|
| 197 |
+
scale=8,
|
| 198 |
+
)
|
| 199 |
+
start_btn = gr.Button(
|
| 200 |
+
value="送信",
|
| 201 |
+
variant="primary",
|
| 202 |
+
scale=2,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
)
|
| 204 |
|
| 205 |
with gr.Accordion(label="詳細設定", open=False):
|