HALcom commited on
Commit
359542d
·
verified ·
1 Parent(s): 15ac269

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,11 +1,13 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # 日本語モデル(無料・公開)
5
  model = pipeline(
6
  "text-generation",
7
- model="elyza/ELYZA-japanese-Llama-2-7b-instruct",
8
- max_new_tokens=300
 
 
9
  )
10
 
11
  def chat(history, user_input):
@@ -14,7 +16,7 @@ def chat(history, user_input):
14
  return history, ""
15
 
16
  with gr.Blocks() as demo:
17
- gr.Markdown("## 📘 日本語文章の要約・質問チャット")
18
 
19
  chatbot = gr.Chatbot(height=500)
20
  text_input = gr.Textbox(
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # 軽量で無料スペースでも動く日本語モデル
5
  model = pipeline(
6
  "text-generation",
7
+ model="rinna/japanese-gpt-neox-3.6b-instruction-sft",
8
+ max_new_tokens=200,
9
+ do_sample=True,
10
+ temperature=0.7
11
  )
12
 
13
  def chat(history, user_input):
 
16
  return history, ""
17
 
18
  with gr.Blocks() as demo:
19
+ gr.Markdown("## 日本語文章の要約・質問チャット(軽量版)")
20
 
21
  chatbot = gr.Chatbot(height=500)
22
  text_input = gr.Textbox(