Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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="
|
| 8 |
-
max_new_tokens=
|
|
|
|
|
|
|
| 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(
|