Commit
•
c7f4d57
1
Parent(s):
477deaa
Update app.py
Browse files
app.py
CHANGED
@@ -2,15 +2,13 @@ import gradio as gr
|
|
2 |
import gc, copy, re
|
3 |
from rwkv.model import RWKV
|
4 |
from rwkv.utils import PIPELINE, PIPELINE_ARGS
|
|
|
5 |
|
6 |
ctx_limit = 4096
|
7 |
-
title = "RWKV-5-World-
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
# urllib.request.urlretrieve(url, title)
|
12 |
-
|
13 |
-
model = RWKV(model=title, strategy='cpu fp16')
|
14 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
15 |
|
16 |
def generate_prompt(instruction, input=None, history=None):
|
|
|
2 |
import gc, copy, re
|
3 |
from rwkv.model import RWKV
|
4 |
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 fp16')
|
|
|
|
|
|
|
12 |
pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
|
13 |
|
14 |
def generate_prompt(instruction, input=None, history=None):
|