HALcom commited on
Commit
15ac269
·
verified ·
1 Parent(s): 0363d82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -1,15 +1,14 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # 日本語対応の Llama3 系モデル(無料)を使用
5
  model = pipeline(
6
  "text-generation",
7
- model="meta-llama/Llama-3-8b-instruct",
8
  max_new_tokens=300
9
  )
10
 
11
  def chat(history, user_input):
12
- # モデルに文章を投げて回答を生成
13
  response = model(user_input)[0]["generated_text"]
14
  history.append((user_input, response))
15
  return history, ""
@@ -30,4 +29,3 @@ with gr.Blocks() as demo:
30
  )
31
 
32
  demo.launch()
33
-
 
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):
 
12
  response = model(user_input)[0]["generated_text"]
13
  history.append((user_input, response))
14
  return history, ""
 
29
  )
30
 
31
  demo.launch()