Update main.py
Browse files
main.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# 初始化pipeline
|
5 |
-
pipe_gpt = pipeline("text-generation", model="FreedomIntelligence/Apollo-
|
6 |
|
7 |
def generate_text(input_text):
|
8 |
output = pipe_gpt(input_text, max_length=500) # 调整max_length来控制生成文本的长度
|
@@ -12,8 +12,8 @@ def generate_text(input_text):
|
|
12 |
iface = gr.Interface(fn=generate_text,
|
13 |
inputs=gr.inputs.Textbox(lines=5, placeholder="Type your prompt here..."),
|
14 |
outputs="text",
|
15 |
-
title="Text Generation with Apollo-
|
16 |
-
description="Enter some text to see how Apollo-
|
17 |
|
18 |
# 运行Gradio应用
|
19 |
iface.launch()
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# 初始化pipeline
|
5 |
+
pipe_gpt = pipeline("text-generation", model="FreedomIntelligence/Apollo-0.5B", trust_remote_code=True)
|
6 |
|
7 |
def generate_text(input_text):
|
8 |
output = pipe_gpt(input_text, max_length=500) # 调整max_length来控制生成文本的长度
|
|
|
12 |
iface = gr.Interface(fn=generate_text,
|
13 |
inputs=gr.inputs.Textbox(lines=5, placeholder="Type your prompt here..."),
|
14 |
outputs="text",
|
15 |
+
title="Text Generation with Apollo-0.5B",
|
16 |
+
description="Enter some text to see how Apollo-0.5B continues it.")
|
17 |
|
18 |
# 运行Gradio应用
|
19 |
iface.launch()
|