Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def generate_prompt(instruction, input=""):
|
|
41 |
if input:
|
42 |
return f"""Instruction: {instruction}\n\nInput: {input}\n\nResponse:"""
|
43 |
else:
|
44 |
-
return f"""User:
|
45 |
|
46 |
def qa_prompt(instruction):
|
47 |
instruction = instruction.strip().replace('\r\n','\n')
|
@@ -108,8 +108,8 @@ def evaluate(
|
|
108 |
yield out_str.strip()
|
109 |
|
110 |
examples = [
|
111 |
-
["Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response
|
112 |
-
["Assistant: How can we persuade Elon Musk to follow you on Twitter? Let's think step by step and provide an expert response
|
113 |
[generate_prompt("東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。"), gen_limit, 1, 0.3, 0.5, 0.5],
|
114 |
[generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), gen_limit, 1, 0.3, 0.5, 0.5],
|
115 |
["A few light taps upon the pane made her turn to the window. It had begun to snow again.", gen_limit, 1, 0.3, 0.5, 0.5],
|
@@ -130,7 +130,7 @@ with gr.Blocks(title=title_v6) as demo:
|
|
130 |
gr.Markdown(f"This is [RWKV-7 World v2.9](https://huggingface.co/BlinkDL/rwkv-7-world) 0.4B (L24-D1024) - a 100% attention-free RNN [RWKV-LM](https://github.com/BlinkDL/RWKV-LM). Supports 100+ world languages and code. Check [400+ Github RWKV projects](https://github.com/search?o=desc&p=1&q=rwkv&s=updated&type=Repositories). *** Can try examples (bottom of page) *** (can edit them). Demo limited to ctxlen {ctx_limit}.")
|
131 |
with gr.Row():
|
132 |
with gr.Column():
|
133 |
-
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
|
134 |
token_count = gr.Slider(10, gen_limit, label="Max Tokens", step=10, value=gen_limit)
|
135 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
136 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
|
|
41 |
if input:
|
42 |
return f"""Instruction: {instruction}\n\nInput: {input}\n\nResponse:"""
|
43 |
else:
|
44 |
+
return f"""User: {instruction}\n\nAssistant:"""
|
45 |
|
46 |
def qa_prompt(instruction):
|
47 |
instruction = instruction.strip().replace('\r\n','\n')
|
|
|
108 |
yield out_str.strip()
|
109 |
|
110 |
examples = [
|
111 |
+
["Assistant: How can we craft an engaging story featuring vampires on Mars? Let's think step by step and provide an expert response:", gen_limit, 1, 0.3, 0.5, 0.5],
|
112 |
+
["Assistant: How can we persuade Elon Musk to follow you on Twitter? Let's think step by step and provide an expert response:", gen_limit, 1, 0.3, 0.5, 0.5],
|
113 |
[generate_prompt("東京で訪れるべき素晴らしい場所とその紹介をいくつか挙げてください。"), gen_limit, 1, 0.3, 0.5, 0.5],
|
114 |
[generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), gen_limit, 1, 0.3, 0.5, 0.5],
|
115 |
["A few light taps upon the pane made her turn to the window. It had begun to snow again.", gen_limit, 1, 0.3, 0.5, 0.5],
|
|
|
130 |
gr.Markdown(f"This is [RWKV-7 World v2.9](https://huggingface.co/BlinkDL/rwkv-7-world) 0.4B (L24-D1024) - a 100% attention-free RNN [RWKV-LM](https://github.com/BlinkDL/RWKV-LM). Supports 100+ world languages and code. Check [400+ Github RWKV projects](https://github.com/search?o=desc&p=1&q=rwkv&s=updated&type=Repositories). *** Can try examples (bottom of page) *** (can edit them). Demo limited to ctxlen {ctx_limit}.")
|
131 |
with gr.Row():
|
132 |
with gr.Column():
|
133 |
+
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:")
|
134 |
token_count = gr.Slider(10, gen_limit, label="Max Tokens", step=10, value=gen_limit)
|
135 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
136 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|