Jae-Won Chung commited on
Commit
a916f49
1 Parent(s): 4cf6de5

Add FastChat xgen inference fix patch

Browse files
deployment/benchmark.Dockerfile CHANGED
@@ -30,6 +30,11 @@ RUN cd /workspace \
30
  && rm -r .git \
31
  && pip install -e .
32
 
 
 
 
 
 
33
  # Where all the weights downloaded from Hugging Face Hub will go to
34
  ENV TRANSFORMERS_CACHE=/data/leaderboard/hfcache
35
 
 
30
  && rm -r .git \
31
  && pip install -e .
32
 
33
+ # Apply patches
34
+ # Salesforce xgen inference fix (https://github.com/lm-sys/FastChat/pull/2350)
35
+ RUN cd /root/.local/miniconda3/lib/python3.9/site-packages/fastchat \
36
+ && patch -p1 < /workspace/leaderboard/deployment/fastchat_xgen_fix.patch
37
+
38
  # Where all the weights downloaded from Hugging Face Hub will go to
39
  ENV TRANSFORMERS_CACHE=/data/leaderboard/hfcache
40
 
deployment/fastchat_xgen_fix.patch ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --- a/fastchat/conversation.py
2
+ +++ b/fastchat/conversation.py
3
+ @@ -787,12 +787,12 @@ def get_conv_template(name: str) -> Conversation:
4
+ Conversation(
5
+ name="xgen",
6
+ system_message="A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n\n",
7
+ - roles=("### Human: ", "###"),
8
+ + roles=("### Human", "### Assistant"),
9
+ messages=(),
10
+ offset=0,
11
+ - sep_style=SeparatorStyle.NO_COLON_SINGLE,
12
+ + sep_style=SeparatorStyle.ADD_COLON_SINGLE,
13
+ sep="\n",
14
+ - stop_token_ids=[50256, 0, 1, 2],
15
+ + stop_token_ids=[50256],
16
+ stop_str="<|endoftext|>",
17
+ )
18
+ )