FredZhang7 commited on
Commit
2f526e4
1 Parent(s): 40c9537

update to rwkv 6 world

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -5,9 +5,10 @@ from rwkv.utils import PIPELINE, PIPELINE_ARGS
5
  from huggingface_hub import hf_hub_download
6
 
7
  ctx_limit = 4096
8
- title = "RWKV-5-World-1B5-v2-20231025-ctx4096"
9
-
10
- model_path = hf_hub_download(repo_id="BlinkDL/rwkv-5-world", filename=f"{title}.pth")
 
11
  model = RWKV(model=model_path, strategy="cpu bf16")
12
  pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
13
 
@@ -25,8 +26,8 @@ def generate_prompt(instruction, input=None, history=None):
25
  for pair in history:
26
  if pair[0] is not None and pair[1] is not None and len(pair[1]) > 0:
27
  input += f"{pair[0]},{pair[1]},"
28
- input += f"{instruction}"
29
- instruction = "Generate a pirate Response using the following information."
30
  if input and len(input) > 0:
31
  input = (
32
  input.strip()
 
5
  from huggingface_hub import hf_hub_download
6
 
7
  ctx_limit = 4096
8
+ # title = "RWKV-5-World-1B5-v2-20231025-ctx4096"
9
+ # "BlinkDL/rwkv-5-world"
10
+ title = "RWKV-x060-World-1B6-v2-20240208-ctx4096.pth"
11
+ model_path = hf_hub_download(repo_id="BlinkDL/rwkv-6-world", filename=f"{title}.pth")
12
  model = RWKV(model=model_path, strategy="cpu bf16")
13
  pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
14
 
 
26
  for pair in history:
27
  if pair[0] is not None and pair[1] is not None and len(pair[1]) > 0:
28
  input += f"{pair[0]},{pair[1]},"
29
+ input = input[-1] + f". {instruction}"
30
+ instruction = "Generate a Response using the following query."
31
  if input and len(input) > 0:
32
  input = (
33
  input.strip()