Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
# 日本語
|
| 5 |
model = pipeline(
|
| 6 |
"text-generation",
|
| 7 |
-
model="
|
| 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()
|
|
|