[webui] improve webui & reasoning mode (#6778)

Former-commit-id: 3f17fc0d7163372e0446f1a38792ff761e99b739
This commit is contained in:
hoshi-hiyouga
2025-01-31 00:09:21 +08:00
committed by GitHub
parent 88546138e1
commit 5abd0168fa
18 changed files with 570 additions and 409 deletions

View File

@@ -40,6 +40,9 @@ def next_page(page_index: int, total_num: int) -> int:
def can_preview(dataset_dir: str, dataset: list) -> "gr.Button":
r"""
Checks if the dataset is a local dataset.
"""
try:
with open(os.path.join(dataset_dir, DATA_CONFIG), encoding="utf-8") as f:
dataset_info = json.load(f)
@@ -67,6 +70,9 @@ def _load_data_file(file_path: str) -> List[Any]:
def get_preview(dataset_dir: str, dataset: list, page_index: int) -> Tuple[int, list, "gr.Column"]:
r"""
Gets the preview samples from the dataset.
"""
with open(os.path.join(dataset_dir, DATA_CONFIG), encoding="utf-8") as f:
dataset_info = json.load(f)