BlinkDL commited on
Commit
bd8572f
1 Parent(s): d2d01b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ model = RWKV(model=model_path, strategy='cuda fp16')
17
  from rwkv.utils import PIPELINE, PIPELINE_ARGS
18
  pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
19
 
20
- def generate_prompt(instruction, input=None):
21
  instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n')
22
  input = input.strip().replace('\r\n','\n').replace('\n\n','\n')
23
  if input:
@@ -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("Instruct mode"):
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
  instruction = gr.Textbox(lines=2, label="Prompt", value=generate_prompt("Tell me about ravens."))
 
17
  from rwkv.utils import PIPELINE, PIPELINE_ARGS
18
  pipeline = PIPELINE(model, "rwkv_vocab_v20230424")
19
 
20
+ def generate_prompt(instruction, input=""):
21
  instruction = instruction.strip().replace('\r\n','\n').replace('\n\n','\n')
22
  input = input.strip().replace('\r\n','\n').replace('\n\n','\n')
23
  if input:
 
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("Instruct mode"):
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
  instruction = gr.Textbox(lines=2, label="Prompt", value=generate_prompt("Tell me about ravens."))