Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,7 @@ import gradio as gr
|
|
3 |
import spaces
|
4 |
# Initialize the text generation pipeline with optimizations
|
5 |
pipe = pipeline("text-generation", model="SakanaAI/EvoLLM-JP-v1-7B")
|
6 |
-
|
7 |
-
def generate_text(prompt):
|
8 |
-
result = pipe(prompt, max_length=50, num_return_sequences=1)
|
9 |
-
return result[0]['generated_text']
|
10 |
|
11 |
# Define a function to generate text based on user input
|
12 |
@spaces.GPU
|
@@ -18,7 +15,7 @@ def generate_text(prompt):
|
|
18 |
iface = gr.Interface(
|
19 |
fn=generate_text,
|
20 |
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
|
21 |
-
outputs="
|
22 |
title="Text Generation with SakanaAI/EvoLLM-JP-v1-7B",
|
23 |
description="Enter a prompt and the model will generate a continuation of the text.",
|
24 |
batch=True,
|
|
|
3 |
import spaces
|
4 |
# Initialize the text generation pipeline with optimizations
|
5 |
pipe = pipeline("text-generation", model="SakanaAI/EvoLLM-JP-v1-7B")
|
6 |
+
|
|
|
|
|
|
|
7 |
|
8 |
# Define a function to generate text based on user input
|
9 |
@spaces.GPU
|
|
|
15 |
iface = gr.Interface(
|
16 |
fn=generate_text,
|
17 |
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
|
18 |
+
outputs=gr.Textbox(label="生成されたテキスト"),
|
19 |
title="Text Generation with SakanaAI/EvoLLM-JP-v1-7B",
|
20 |
description="Enter a prompt and the model will generate a continuation of the text.",
|
21 |
batch=True,
|