Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from pynvml import *
|
|
| 6 |
nvmlInit()
|
| 7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
| 8 |
ctx_limit = 1024
|
| 9 |
-
title = "RWKV-4-Raven-7B-
|
| 10 |
|
| 11 |
os.environ["RWKV_JIT_ON"] = '1'
|
| 12 |
os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
|
|
@@ -91,13 +91,13 @@ def evaluate(
|
|
| 91 |
yield out_str.strip()
|
| 92 |
|
| 93 |
examples = [
|
| 94 |
-
["Tell me about ravens.", "", 150, 1.2, 0.5, 0.
|
| 95 |
-
["Write a python function to mine 1 BTC, with details and comments.", "", 150, 1.2, 0.5, 0.
|
| 96 |
-
["Write a song about ravens.", "", 150, 1.2, 0.5, 0.
|
| 97 |
-
["Explain the following metaphor: Life is like cats.", "", 150, 1.2, 0.5, 0.
|
| 98 |
-
["Write a story using the following information", "A man named Alex chops a tree down", 150, 1.2, 0.5, 0.
|
| 99 |
-
["Generate a list of adjectives that describe a person as brave.", "", 150, 1.2, 0.5, 0.
|
| 100 |
-
["You have $100, and your goal is to turn that into as much money as possible with AI and Machine Learning. Please respond with detailed plan.", "", 150, 1.2, 0.5, 0.
|
| 101 |
]
|
| 102 |
|
| 103 |
##########################################################################
|
|
@@ -250,8 +250,8 @@ with gr.Blocks(title=title) as demo:
|
|
| 250 |
token_count = gr.Slider(10, 200, label="Max Tokens", step=10, value=150)
|
| 251 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.2)
|
| 252 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.5)
|
| 253 |
-
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.
|
| 254 |
-
count_penalty = gr.Slider(0.0, 1.0, label="Count Penalty", step=0.1, value=0.
|
| 255 |
with gr.Column():
|
| 256 |
with gr.Row():
|
| 257 |
submit = gr.Button("Submit", variant="primary")
|
|
@@ -280,8 +280,8 @@ with gr.Blocks(title=title) as demo:
|
|
| 280 |
prompt = gr.Textbox(lines=10, max_lines=50, label="Scenario", value=chat_intro)
|
| 281 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.2)
|
| 282 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.5)
|
| 283 |
-
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.
|
| 284 |
-
count_penalty = gr.Slider(0.0, 1.0, label="Count Penalty", step=0.1, value=0.
|
| 285 |
chat_inputs = [
|
| 286 |
prompt,
|
| 287 |
user_name,
|
|
|
|
| 6 |
nvmlInit()
|
| 7 |
gpu_h = nvmlDeviceGetHandleByIndex(0)
|
| 8 |
ctx_limit = 1024
|
| 9 |
+
title = "RWKV-4-Raven-7B-v10-Eng99%-Other1%-20230418-ctx8192"
|
| 10 |
|
| 11 |
os.environ["RWKV_JIT_ON"] = '1'
|
| 12 |
os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
|
|
|
|
| 91 |
yield out_str.strip()
|
| 92 |
|
| 93 |
examples = [
|
| 94 |
+
["Tell me about ravens.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 95 |
+
["Write a python function to mine 1 BTC, with details and comments.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 96 |
+
["Write a song about ravens.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 97 |
+
["Explain the following metaphor: Life is like cats.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 98 |
+
["Write a story using the following information", "A man named Alex chops a tree down", 150, 1.2, 0.5, 0.4, 0.4],
|
| 99 |
+
["Generate a list of adjectives that describe a person as brave.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 100 |
+
["You have $100, and your goal is to turn that into as much money as possible with AI and Machine Learning. Please respond with detailed plan.", "", 150, 1.2, 0.5, 0.4, 0.4],
|
| 101 |
]
|
| 102 |
|
| 103 |
##########################################################################
|
|
|
|
| 250 |
token_count = gr.Slider(10, 200, label="Max Tokens", step=10, value=150)
|
| 251 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.2)
|
| 252 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.5)
|
| 253 |
+
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.4)
|
| 254 |
+
count_penalty = gr.Slider(0.0, 1.0, label="Count Penalty", step=0.1, value=0.4)
|
| 255 |
with gr.Column():
|
| 256 |
with gr.Row():
|
| 257 |
submit = gr.Button("Submit", variant="primary")
|
|
|
|
| 280 |
prompt = gr.Textbox(lines=10, max_lines=50, label="Scenario", value=chat_intro)
|
| 281 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.2)
|
| 282 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.5)
|
| 283 |
+
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=0.4)
|
| 284 |
+
count_penalty = gr.Slider(0.0, 1.0, label="Count Penalty", step=0.1, value=0.4)
|
| 285 |
chat_inputs = [
|
| 286 |
prompt,
|
| 287 |
user_name,
|