BlinkDL commited on
Commit
1085c99
1 Parent(s): 967ba51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -18,11 +18,12 @@ nvmlInit()
18
  gpu_h = nvmlDeviceGetHandleByIndex(0)
19
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
20
 
21
- ctx_limit = 3000
 
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,7 +110,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.", 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],
@@ -275,7 +276,7 @@ with gr.Blocks(title=title) as demo:
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)
 
18
  gpu_h = nvmlDeviceGetHandleByIndex(0)
19
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
20
 
21
+ ctx_limit = 2500
22
+ gen_limit = 500
23
  ########################## text rwkv ################################################################
24
  from rwkv.utils import PIPELINE, PIPELINE_ARGS
25
 
26
+ title_v6 = "RWKV-x060-World-3B-v2.1-20240417-ctx4096"
27
  model_path_v6 = hf_hub_download(repo_id="BlinkDL/rwkv-6-world", filename=f"{title_v6}.pth")
28
  model_v6 = RWKV(model=model_path_v6, strategy='cuda fp16')
29
  pipeline_v6 = PIPELINE(model_v6, "rwkv_vocab_v20230424")
 
110
  yield out_str.strip()
111
 
112
  examples = [
113
+ ["Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response.", 500, 1, 0.3, 0, 1],
114
  ["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],
115
  [generate_prompt("東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。"), 500, 1, 0.3, 0, 1],
116
  [generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), 500, 1, 0.3, 0, 1],
 
276
  with gr.Row():
277
  with gr.Column():
278
  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.")
279
+ token_count = gr.Slider(10, gen_limit, label="Max Tokens", step=10, value=gen_limit)
280
  temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
281
  top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
282
  presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0)