Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: 修复由于不够鲁棒的正则表达式而导致的问题 #867

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/qianfan/resources/batch_inference/helper/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def wait_bf_task(

class BatchInferenceHelper:
# 使用正则表达式来匹配文件名和大小
jsonl_files_pattern = re.compile(r"(\d+)\s+(\S+jsonl)")
jsonl_files_pattern = re.compile(r"(\d+)\s+(\S+\.(jsonl|json))")

def __init__(
self,
Expand Down Expand Up @@ -445,7 +445,7 @@ def filter_jsonl_files(self, output: str) -> List:

res = []
# 打印结果
for size, filename in matches:
for size, filename, suffix in matches:
log_debug(f"File: {filename}, Size: {size}")
res.append({"path": filename, "size": int(size)})
return res
Expand Down
Loading