Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ ctx_limit = 3000
|
|
22 |
########################## text rwkv ################################################################
|
23 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
24 |
|
25 |
-
title_v6 = "RWKV-x060-World-
|
26 |
model_path_v6 = hf_hub_download(repo_id="BlinkDL/rwkv-6-world", filename=f"{title_v6}.pth")
|
27 |
model_v6 = RWKV(model=model_path_v6, strategy='cuda fp16')
|
28 |
pipeline_v6 = PIPELINE(model_v6, "rwkv_vocab_v20230424")
|
@@ -109,7 +109,7 @@ def evaluate(
|
|
109 |
yield out_str.strip()
|
110 |
|
111 |
examples = [
|
112 |
-
["Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response.",
|
113 |
["Assistant: How can we persuade Elon Musk to follow you on Twitter? Let's think step by step and provide an expert response.", 500, 1, 0.3, 0, 1],
|
114 |
[generate_prompt("東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。"), 500, 1, 0.3, 0, 1],
|
115 |
[generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), 500, 1, 0.3, 0, 1],
|
@@ -271,11 +271,11 @@ def chatbot(image, question):
|
|
271 |
with gr.Blocks(title=title) as demo:
|
272 |
gr.HTML(f"<div style=\"text-align: center;\">\n<h1>{title_v6}</h1>\n</div>")
|
273 |
with gr.Tab("Raw Generation"):
|
274 |
-
gr.Markdown(f"This is [RWKV-6 World v2](https://huggingface.co/BlinkDL/rwkv-6-world)
|
275 |
with gr.Row():
|
276 |
with gr.Column():
|
277 |
prompt = gr.Textbox(lines=2, label="Prompt", value="Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response.")
|
278 |
-
token_count = gr.Slider(10,
|
279 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
280 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
281 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0)
|
|
|
22 |
########################## text rwkv ################################################################
|
23 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
24 |
|
25 |
+
title_v6 = "RWKV-x060-World-1B6-v2.1-20240328-ctx4096"
|
26 |
model_path_v6 = hf_hub_download(repo_id="BlinkDL/rwkv-6-world", filename=f"{title_v6}.pth")
|
27 |
model_v6 = RWKV(model=model_path_v6, strategy='cuda fp16')
|
28 |
pipeline_v6 = PIPELINE(model_v6, "rwkv_vocab_v20230424")
|
|
|
109 |
yield out_str.strip()
|
110 |
|
111 |
examples = [
|
112 |
+
["Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response.", 700, 1, 0.3, 0, 1],
|
113 |
["Assistant: How can we persuade Elon Musk to follow you on Twitter? Let's think step by step and provide an expert response.", 500, 1, 0.3, 0, 1],
|
114 |
[generate_prompt("東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。"), 500, 1, 0.3, 0, 1],
|
115 |
[generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), 500, 1, 0.3, 0, 1],
|
|
|
271 |
with gr.Blocks(title=title) as demo:
|
272 |
gr.HTML(f"<div style=\"text-align: center;\">\n<h1>{title_v6}</h1>\n</div>")
|
273 |
with gr.Tab("Raw Generation"):
|
274 |
+
gr.Markdown(f"This is [RWKV-6 World v2](https://huggingface.co/BlinkDL/rwkv-6-world) - a 100% attention-free RNN [RWKV-LM](https://github.com/BlinkDL/RWKV-LM). Supports 100+ world languages and code. And we have [300+ Github RWKV projects](https://github.com/search?o=desc&p=1&q=rwkv&s=updated&type=Repositories). *** Please try examples first (bottom of page) *** (edit them to use your question). Demo limited to ctxlen {ctx_limit}. (VisualRWKV is using RWKV5 1.5B)")
|
275 |
with gr.Row():
|
276 |
with gr.Column():
|
277 |
prompt = gr.Textbox(lines=2, label="Prompt", value="Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response.")
|
278 |
+
token_count = gr.Slider(10, 700, label="Max Tokens", step=10, value=700)
|
279 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
280 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
281 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0)
|