p1atdev commited on
Commit
f41ec92
·
verified ·
1 Parent(s): cb7c8fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -21
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
- MODEL_NAME, quantization_config=quantization_config, device_map="auto"
54
- ) for key, value in MODEL_NAME_MAP.items()
55
  }
56
  TOKENIZERS = {
57
- key: AutoTokenizer.from_pretrained(MODEL_NAME) for key, value in MODEL_NAME_MAP.items()
58
 
59
  }
60
 
@@ -189,21 +189,17 @@ def demo():
189
  components=[chat_history], value="🗑️ 削除", scale=1,
190
  )
191
 
192
- with gr.Group():
193
- with gr.Row():
194
- input_text = gr.Textbox(
195
- value="",
196
- placeholder="質問を入力してください...",
197
- show_label=False,
198
- scale=8,
199
- )
200
- start_btn = gr.Button(
201
- value="送信",
202
- variant="primary",
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):