Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ nvmlInit()
|
|
| 7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
| 8 |
ctx_limit = 1024
|
| 9 |
gen_limit = 500
|
|
|
|
| 10 |
title = "RWKV-x060-World-7B-v2.1-20240507-ctx4096"
|
| 11 |
|
| 12 |
os.environ["RWKV_JIT_ON"] = '1'
|
|
@@ -23,8 +24,8 @@ from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
|
| 23 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
| 24 |
|
| 25 |
args = model.args
|
| 26 |
-
eng_name = 'rwkv-x060-eng_single_round_qa-7B-
|
| 27 |
-
chn_name = 'rwkv-x060-chn_single_round_qa-7B-
|
| 28 |
eng_file = hf_hub_download(repo_id="BlinkDL/temp-latest-training-models", filename=f"{eng_name}.pth")
|
| 29 |
chn_file = hf_hub_download(repo_id="BlinkDL/temp-latest-training-models", filename=f"{chn_name}.pth")
|
| 30 |
state_eng_raw = torch.load(eng_file)
|
|
@@ -223,22 +224,22 @@ examples = [
|
|
| 223 |
]
|
| 224 |
|
| 225 |
examples_eng = [
|
| 226 |
-
["How can I craft an engaging story featuring vampires on Mars?",
|
| 227 |
-
["Compare the business models of Apple and Google.",
|
| 228 |
-
["In JSON format, list the top 5 tourist attractions in Paris.",
|
| 229 |
-
["Write an outline for a fantasy novel where dreams can alter reality.",
|
| 230 |
-
["Can fish get thirsty?",
|
| 231 |
-
["Write a Bash script to check disk usage and send alerts if it's too high.",
|
| 232 |
-
["Write a simple website in HTML. When a user clicks the button, it shows a random joke from a list of 4 jokes.",
|
| 233 |
]
|
| 234 |
|
| 235 |
examples_chn = [
|
| 236 |
-
["怎样写一个在火星上的吸血鬼的有趣故事?",
|
| 237 |
-
["比较苹果和谷歌的商业模式。",
|
| 238 |
-
["鱼会口渴吗?",
|
| 239 |
-
["以 JSON 格式解释冰箱是如何工作的。",
|
| 240 |
-
["编写一个Bash脚本来检查磁盘使用情况,如果使用量过高则发送警报。",
|
| 241 |
-
["用HTML编写一个简单的网站。当用户点击按钮时,从4个笑话的列表中随机显示一个笑话。",
|
| 242 |
]
|
| 243 |
|
| 244 |
##########################################################################
|
|
@@ -271,7 +272,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 271 |
with gr.Row():
|
| 272 |
with gr.Column():
|
| 273 |
prompt = gr.Textbox(lines=2, label="Prompt", value="How can I craft an engaging story featuring vampires on Mars?")
|
| 274 |
-
token_count = gr.Slider(10,
|
| 275 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 276 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.2)
|
| 277 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.3)
|
|
@@ -291,7 +292,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 291 |
with gr.Row():
|
| 292 |
with gr.Column():
|
| 293 |
prompt = gr.Textbox(lines=2, label="Prompt", value="怎样写一个在火星上的吸血鬼的有趣故事?")
|
| 294 |
-
token_count = gr.Slider(10,
|
| 295 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 296 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.2)
|
| 297 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.3)
|
|
|
|
| 7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
| 8 |
ctx_limit = 1024
|
| 9 |
gen_limit = 500
|
| 10 |
+
gen_limit_long = 800
|
| 11 |
title = "RWKV-x060-World-7B-v2.1-20240507-ctx4096"
|
| 12 |
|
| 13 |
os.environ["RWKV_JIT_ON"] = '1'
|
|
|
|
| 24 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
| 25 |
|
| 26 |
args = model.args
|
| 27 |
+
eng_name = 'rwkv-x060-eng_single_round_qa-7B-20240516-ctx2048'
|
| 28 |
+
chn_name = 'rwkv-x060-chn_single_round_qa-7B-20240516-ctx2048'
|
| 29 |
eng_file = hf_hub_download(repo_id="BlinkDL/temp-latest-training-models", filename=f"{eng_name}.pth")
|
| 30 |
chn_file = hf_hub_download(repo_id="BlinkDL/temp-latest-training-models", filename=f"{chn_name}.pth")
|
| 31 |
state_eng_raw = torch.load(eng_file)
|
|
|
|
| 224 |
]
|
| 225 |
|
| 226 |
examples_eng = [
|
| 227 |
+
["How can I craft an engaging story featuring vampires on Mars?", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 228 |
+
["Compare the business models of Apple and Google.", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 229 |
+
["In JSON format, list the top 5 tourist attractions in Paris.", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 230 |
+
["Write an outline for a fantasy novel where dreams can alter reality.", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 231 |
+
["Can fish get thirsty?", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 232 |
+
["Write a Bash script to check disk usage and send alerts if it's too high.", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 233 |
+
["Write a simple website in HTML. When a user clicks the button, it shows a random joke from a list of 4 jokes.", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 234 |
]
|
| 235 |
|
| 236 |
examples_chn = [
|
| 237 |
+
["怎样写一个在火星上的吸血鬼的有趣故事?", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 238 |
+
["比较苹果和谷歌的商业模式。", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 239 |
+
["鱼会口渴吗?", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 240 |
+
["以 JSON 格式解释冰箱是如何工作的。", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 241 |
+
["编写一个Bash脚本来检查磁盘使用情况,如果使用量过高则发送警报。", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 242 |
+
["用HTML编写一个简单的网站。当用户点击按钮时,从4个笑话的列表中随机显示一个笑话。", gen_limit_long, 1, 0.2, 0.3, 0.3],
|
| 243 |
]
|
| 244 |
|
| 245 |
##########################################################################
|
|
|
|
| 272 |
with gr.Row():
|
| 273 |
with gr.Column():
|
| 274 |
prompt = gr.Textbox(lines=2, label="Prompt", value="How can I craft an engaging story featuring vampires on Mars?")
|
| 275 |
+
token_count = gr.Slider(10, gen_limit_long, label="Max Tokens", step=10, value=gen_limit_long)
|
| 276 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 277 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.2)
|
| 278 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.3)
|
|
|
|
| 292 |
with gr.Row():
|
| 293 |
with gr.Column():
|
| 294 |
prompt = gr.Textbox(lines=2, label="Prompt", value="怎样写一个在火星上的吸血鬼的有趣故事?")
|
| 295 |
+
token_count = gr.Slider(10, gen_limit_long, label="Max Tokens", step=10, value=gen_limit_long)
|
| 296 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 297 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.2)
|
| 298 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.3)
|