Skip to content

Commit 79e9d3f

Browse files
authored
Remove extra opening of chat_template file. (#1071)
1 parent dea69e1 commit 79e9d3f

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

lmms_eval/models/chat/vllm.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,11 @@ def generate_until(self, requests) -> List[str]:
105105

106106
sampling_params = SamplingParams(**sampling_params)
107107
start_time = time.time()
108-
if self.chat_template is not None:
109-
with open(self.chat_template, "r") as f:
110-
chat_template = f.read()
111-
response = self.client.chat(
112-
sampling_params=sampling_params,
113-
messages=batched_messages,
114-
chat_template=chat_template,
115-
)
116-
else:
117-
response = self.client.chat(sampling_params=sampling_params, messages=batched_messages)
108+
response = self.client.chat(
109+
sampling_params=sampling_params,
110+
messages=batched_messages,
111+
chat_template=self.chat_template
112+
)
118113
end_time = time.time()
119114

120115
response_text = [o.outputs[0].text for o in response]

0 commit comments

Comments
 (0)