Improve benchmark scripts & add more models (#484)

This commit is contained in:
Lianmin Zheng
2024-05-27 14:13:26 -07:00
committed by GitHub
parent 55c1643627
commit 09de730dee
6 changed files with 1173 additions and 11 deletions

View File

@@ -95,6 +95,11 @@ def call_generate_xinfer(prompt, temperature, max_tokens, stop=None, url=None):
sampler_channel = grpc.insecure_channel(url.replace("http://", ""))
sampler = sampler_pb2_grpc.SamplerStub(sampler_channel)
if stop is None:
stop_strings = None
else:
stop_strings = [stop]
sample_request = sampler_pb2.SampleTextRequest(
prompt=prompt,
settings=sampler_pb2.SampleSettings(
@@ -102,7 +107,7 @@ def call_generate_xinfer(prompt, temperature, max_tokens, stop=None, url=None):
rng_seed=0,
temperature=max(temperature, 1e-7),
nucleus_p=1,
stop_strings=[stop],
stop_strings=stop_strings,
),
)
stream = sampler.SampleText(sample_request)