Update benchmarks to use HF token from environment. (#15421)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Frank
2025-12-18 13:47:27 -08:00
committed by GitHub
co-authored by gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent 2b0ddf89f5
commit 9749d3e346
2 changed files with 34 additions and 8 deletions
+11 -5
View File
@@ -11,10 +11,10 @@ from nextqa import NExTQALoader
from tqdm.asyncio import tqdm
from transformers import PreTrainedTokenizerBase
SHAREGPT_URL = "https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json"
from sglang.bench_serving import (
download_and_cache_file,
SHAREGPT_FILENAME,
SHAREGPT_REPO_ID,
download_and_cache_hf_file,
gen_prompt,
get_gen_prefix_cache_path,
)
@@ -104,7 +104,10 @@ def sample_sharegpt_requests(
# Download sharegpt if necessary
if not os.path.isfile(dataset_path):
dataset_path = download_and_cache_file(SHAREGPT_URL)
dataset_path = download_and_cache_hf_file(
repo_id=SHAREGPT_REPO_ID,
filename=SHAREGPT_FILENAME,
)
# Load the dataset.
with open(dataset_path) as f:
@@ -367,7 +370,10 @@ def sample_random_requests(
# Download sharegpt if necessary
if not os.path.isfile(dataset_path):
dataset_path = download_and_cache_file(SHAREGPT_URL)
dataset_path = download_and_cache_hf_file(
repo_id=SHAREGPT_REPO_ID,
filename=SHAREGPT_FILENAME,
)
# Load the dataset.
with open(dataset_path) as f: