Spaces:
Runtime error
Runtime error
update for gpt-j-6b
Browse files
app.py
CHANGED
@@ -13,7 +13,8 @@ import requests
|
|
13 |
|
14 |
from fastchat.conversation import (
|
15 |
Conversation,
|
16 |
-
|
|
|
17 |
SeparatorStyle,
|
18 |
)
|
19 |
from fastchat.constants import LOGDIR
|
@@ -46,19 +47,19 @@ conv_template_bf16 = Conversation(
|
|
46 |
offset=0,
|
47 |
sep_style=SeparatorStyle.SINGLE,
|
48 |
sep="\n",
|
49 |
-
sep2="</s>",
|
50 |
-
)
|
51 |
-
|
52 |
-
conv_template_bf16 = Conversation(
|
53 |
-
system="",
|
54 |
-
roles=("", ""),
|
55 |
-
messages=(),
|
56 |
-
offset=0,
|
57 |
-
sep_style=SeparatorStyle.OASST_PYTHIA,
|
58 |
-
sep=" ",
|
59 |
sep2="<|endoftext|>",
|
60 |
)
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
def set_global_vars(controller_url_, enable_moderation_):
|
64 |
global controller_url, enable_moderation
|
@@ -238,7 +239,7 @@ def http_bot(state, model_selector, temperature, max_new_tokens, request: gr.Req
|
|
238 |
|
239 |
# Construct prompt
|
240 |
prompt = state.get_prompt()
|
241 |
-
skip_echo_len = compute_skip_echo_len(model_name, state, prompt)
|
242 |
|
243 |
# Make requests
|
244 |
pload = {
|
|
|
13 |
|
14 |
from fastchat.conversation import (
|
15 |
Conversation,
|
16 |
+
|
17 |
+
,
|
18 |
SeparatorStyle,
|
19 |
)
|
20 |
from fastchat.constants import LOGDIR
|
|
|
47 |
offset=0,
|
48 |
sep_style=SeparatorStyle.SINGLE,
|
49 |
sep="\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
sep2="<|endoftext|>",
|
51 |
)
|
52 |
|
53 |
+
# conv_template_bf16 = Conversation(
|
54 |
+
# system="",
|
55 |
+
# roles=("", ""),
|
56 |
+
# messages=(),
|
57 |
+
# offset=0,
|
58 |
+
# sep_style=SeparatorStyle.OASST_PYTHIA,
|
59 |
+
# sep=" ",
|
60 |
+
# sep2="<|endoftext|>",
|
61 |
+
# )
|
62 |
+
|
63 |
|
64 |
def set_global_vars(controller_url_, enable_moderation_):
|
65 |
global controller_url, enable_moderation
|
|
|
239 |
|
240 |
# Construct prompt
|
241 |
prompt = state.get_prompt()
|
242 |
+
skip_echo_len = compute_skip_echo_len(model_name, state, prompt) - 1
|
243 |
|
244 |
# Make requests
|
245 |
pload = {
|