Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ HAS_GPU = False
|
|
9 |
|
10 |
# Model title and context size limit
|
11 |
ctx_limit = 4000
|
12 |
-
title = "
|
13 |
model_file = "RWKV-5-World-1B5-v2-20231025-ctx4096"
|
14 |
|
15 |
#title = "RWKV-4-World"
|
@@ -143,8 +143,10 @@ def evaluate(
|
|
143 |
|
144 |
# Examples and gradio blocks
|
145 |
examples = [
|
146 |
-
["Write a song about flowers.", "",
|
147 |
-
["寫一篇關於交通工程的車流理論模型之論文,需要詳細全面。",
|
|
|
|
|
148 |
#["Assistant: Sure! Here is a very detailed plan to create flying pigs:", 333, 1, 0.3, 0, 1],
|
149 |
#["Assistant: Sure! Here are some ideas for FTL drive:", 333, 1, 0.3, 0, 1],
|
150 |
#[generate_prompt("Tell me about ravens."), 333, 1, 0.3, 0, 1],
|
@@ -177,10 +179,10 @@ with gr.Blocks(title=title) as demo:
|
|
177 |
with gr.Column():
|
178 |
#prompt = gr.Textbox(lines=2, label="Prompt", value="Assistant: Sure! Here is a very detailed plan to create flying pigs:")
|
179 |
|
180 |
-
instruction = gr.Textbox(lines=2, label="Instruction", value='
|
181 |
input = gr.Textbox(lines=2, label="Input", placeholder="none")
|
182 |
|
183 |
-
token_count = gr.Slider(10,
|
184 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
185 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
186 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0)
|
@@ -202,5 +204,5 @@ with gr.Blocks(title=title) as demo:
|
|
202 |
data.click(lambda x: x, [data], [instruction, input, token_count, temperature, top_p, presence_penalty, count_penalty])
|
203 |
|
204 |
# Gradio launch
|
205 |
-
demo.queue(concurrency_count=1, max_size=
|
206 |
demo.launch(share=False)
|
|
|
9 |
|
10 |
# Model title and context size limit
|
11 |
ctx_limit = 4000
|
12 |
+
title = "1B5"
|
13 |
model_file = "RWKV-5-World-1B5-v2-20231025-ctx4096"
|
14 |
|
15 |
#title = "RWKV-4-World"
|
|
|
143 |
|
144 |
# Examples and gradio blocks
|
145 |
examples = [
|
146 |
+
["Write a song about flowers.", "", 600, 1.2, 0.5, 0.4, 0.4],
|
147 |
+
["寫一篇關於交通工程的車流理論模型之論文,需要詳細全面。","", 600, 1.2, 0.5, 0.4, 0.4],
|
148 |
+
["根據以下資訊,寫一篇文情並茂的文章。", "一位中年男子為追求事業成就,不斷奮鬥突破眼前遇到的難關。", 600, 1.2, 0.5, 0.4, 0.4]
|
149 |
+
|
150 |
#["Assistant: Sure! Here is a very detailed plan to create flying pigs:", 333, 1, 0.3, 0, 1],
|
151 |
#["Assistant: Sure! Here are some ideas for FTL drive:", 333, 1, 0.3, 0, 1],
|
152 |
#[generate_prompt("Tell me about ravens."), 333, 1, 0.3, 0, 1],
|
|
|
179 |
with gr.Column():
|
180 |
#prompt = gr.Textbox(lines=2, label="Prompt", value="Assistant: Sure! Here is a very detailed plan to create flying pigs:")
|
181 |
|
182 |
+
instruction = gr.Textbox(lines=2, label="Instruction", value='Write a song about flowers.')
|
183 |
input = gr.Textbox(lines=2, label="Input", placeholder="none")
|
184 |
|
185 |
+
token_count = gr.Slider(10, 1000, label="Max Tokens", step=10, value=600)
|
186 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
187 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
188 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0)
|
|
|
204 |
data.click(lambda x: x, [data], [instruction, input, token_count, temperature, top_p, presence_penalty, count_penalty])
|
205 |
|
206 |
# Gradio launch
|
207 |
+
demo.queue(concurrency_count=1, max_size=10)
|
208 |
demo.launch(share=False)
|