Commit
·
6dd6d2b
1
Parent(s):
687f9e7
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,7 +88,7 @@ def evaluate(
|
|
| 88 |
max_new_tokens=128,
|
| 89 |
**kwargs,
|
| 90 |
):
|
| 91 |
-
if instruction == None:
|
| 92 |
return 'Instruction not found. Please enter your instruction.\nInstructionを入力してください。'
|
| 93 |
prompt = generate_prompt(instruction, input)
|
| 94 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
@@ -118,12 +118,12 @@ g = gr.Interface(
|
|
| 118 |
inputs=[
|
| 119 |
gr.components.Textbox(
|
| 120 |
lines=2, label="Instruction", placeholder="例1:日本語から英語に翻訳してください。\n\
|
| 121 |
-
|
| 122 |
-
|
| 123 |
),
|
| 124 |
gr.components.Textbox(lines=2, label="Input", placeholder="例1:日本語のテキスト\n\
|
| 125 |
-
|
| 126 |
-
|
| 127 |
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
| 128 |
gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
|
| 129 |
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|
|
@@ -140,10 +140,10 @@ g = gr.Interface(
|
|
| 140 |
],
|
| 141 |
title="Llama2_7b_chat_Japanese_Lora",
|
| 142 |
description="Llama-2-7b-chat-Japanese-LoRA is a multi-purpose large language model for Japanese text.\n\
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
)
|
| 148 |
g.queue(concurrency_count=1)
|
| 149 |
g.launch()
|
|
|
|
| 88 |
max_new_tokens=128,
|
| 89 |
**kwargs,
|
| 90 |
):
|
| 91 |
+
if instruction == '' or instruction == None:
|
| 92 |
return 'Instruction not found. Please enter your instruction.\nInstructionを入力してください。'
|
| 93 |
prompt = generate_prompt(instruction, input)
|
| 94 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
|
| 118 |
inputs=[
|
| 119 |
gr.components.Textbox(
|
| 120 |
lines=2, label="Instruction", placeholder="例1:日本語から英語に翻訳してください。\n\
|
| 121 |
+
例2:このテキストを要約してください。\n\
|
| 122 |
+
例3:英語から日本語に翻訳してください。"
|
| 123 |
),
|
| 124 |
gr.components.Textbox(lines=2, label="Input", placeholder="例1:日本語のテキスト\n\
|
| 125 |
+
例2:日本語の長いテキスト\n\
|
| 126 |
+
例3:英語のテキスト"),
|
| 127 |
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
| 128 |
gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
|
| 129 |
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|
|
|
|
| 140 |
],
|
| 141 |
title="Llama2_7b_chat_Japanese_Lora",
|
| 142 |
description="Llama-2-7b-chat-Japanese-LoRA is a multi-purpose large language model for Japanese text.\n\
|
| 143 |
+
This model is presented by the joint effort of Sparticle Inc. and A. I. Hakusan Inc.\n\
|
| 144 |
+
Llama-2-7b-chat-Japanese-LoRAは日本語テキストのための多目的大規模言語モデルです。\n\
|
| 145 |
+
このモデルは日本語が話せる。日本語での指示や入力が可能です。\n\
|
| 146 |
+
このモデルは、Sparticle株式会社と株式会社白山人工知能の共同開発により発表されました。",
|
| 147 |
)
|
| 148 |
g.queue(concurrency_count=1)
|
| 149 |
g.launch()
|