Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import hf_hub_download
|
|
5 |
from pynvml import *
|
6 |
nvmlInit()
|
7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
8 |
-
ctx_limit =
|
9 |
title = "RWKV-5-World-1.5B-v2-OnlyForTest_56%_trained-20231013-ctx4096"
|
10 |
|
11 |
os.environ["RWKV_JIT_ON"] = '1'
|
@@ -97,7 +97,7 @@ examples = [
|
|
97 |
with gr.Blocks(title=title) as demo:
|
98 |
gr.HTML(f"<div style=\"text-align: center;\">\n<h1>RWKV-5 World v2 - {title}</h1>\n</div>")
|
99 |
with gr.Tab("Free Generation"):
|
100 |
-
gr.Markdown(f"This is a ***1.5B***
|
101 |
with gr.Row():
|
102 |
with gr.Column():
|
103 |
prompt = gr.Textbox(lines=2, label="Prompt", value=generate_prompt("Tell me about ravens."))
|
@@ -110,7 +110,7 @@ with gr.Blocks(title=title) as demo:
|
|
110 |
with gr.Row():
|
111 |
submit = gr.Button("Submit", variant="primary")
|
112 |
clear = gr.Button("Clear", variant="secondary")
|
113 |
-
output = gr.Textbox(label="Output", lines=
|
114 |
data = gr.Dataset(components=[prompt, token_count, temperature, top_p, presence_penalty, count_penalty], samples=examples, label="Example Instructions", headers=["Prompt", "Max Tokens", "Temperature", "Top P", "Presence Penalty", "Count Penalty"])
|
115 |
submit.click(evaluate, [prompt, token_count, temperature, top_p, presence_penalty, count_penalty], [output])
|
116 |
clear.click(lambda: None, [], [output])
|
|
|
5 |
from pynvml import *
|
6 |
nvmlInit()
|
7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
8 |
+
ctx_limit = 2000
|
9 |
title = "RWKV-5-World-1.5B-v2-OnlyForTest_56%_trained-20231013-ctx4096"
|
10 |
|
11 |
os.environ["RWKV_JIT_ON"] = '1'
|
|
|
97 |
with gr.Blocks(title=title) as demo:
|
98 |
gr.HTML(f"<div style=\"text-align: center;\">\n<h1>RWKV-5 World v2 - {title}</h1>\n</div>")
|
99 |
with gr.Tab("Free Generation"):
|
100 |
+
gr.Markdown(f"This is a *** 1.5B *** [RWKV-5 World v2](https://huggingface.co/BlinkDL/rwkv-5-world), which is 100% RNN [RWKV-LM](https://github.com/BlinkDL/RWKV-LM) and attention-free. *** Please try examples first (bottom of page) *** (edit them to use your question). Demo limited to ctxlen {ctx_limit}. For best results, *** keep you prompt short and clear ***.")
|
101 |
with gr.Row():
|
102 |
with gr.Column():
|
103 |
prompt = gr.Textbox(lines=2, label="Prompt", value=generate_prompt("Tell me about ravens."))
|
|
|
110 |
with gr.Row():
|
111 |
submit = gr.Button("Submit", variant="primary")
|
112 |
clear = gr.Button("Clear", variant="secondary")
|
113 |
+
output = gr.Textbox(label="Output", lines=20)
|
114 |
data = gr.Dataset(components=[prompt, token_count, temperature, top_p, presence_penalty, count_penalty], samples=examples, label="Example Instructions", headers=["Prompt", "Max Tokens", "Temperature", "Top P", "Presence Penalty", "Count Penalty"])
|
115 |
submit.click(evaluate, [prompt, token_count, temperature, top_p, presence_penalty, count_penalty], [output])
|
116 |
clear.click(lambda: None, [], [output])
|