Calling parameters from config.py

This commit is contained in:
Mxode 2024-03-08 19:00:45 +08:00
parent b6eca08fb8
commit 07527619fd

View File

@ -3,7 +3,7 @@ import json
from tqdm import tqdm from tqdm import tqdm
from datetime import datetime from datetime import datetime
from config.config import result_dir from config.config import result_dir, storage_interval, window_size, overlap_size
from model.qwen import call_qwen_single_turn from model.qwen import call_qwen_single_turn
from util.logger import get_logger from util.logger import get_logger
from util.data_loader import get_file_list, get_txt_content, capture_qa from util.data_loader import get_file_list, get_txt_content, capture_qa
@ -35,7 +35,7 @@ def generate_qa(
storage_counter = 0 storage_counter = 0
storage_list = [] storage_list = []
for file_path in file_list: for file_path in file_list:
contents = get_txt_content(file_path) contents = get_txt_content(file_path, window_size=window_size, overlap_size=overlap_size)
storage_list = [] storage_list = []
_, file_name = os.path.split(file_path) _, file_name = os.path.split(file_path)
@ -72,4 +72,4 @@ if __name__ == '__main__':
# 创建generated文件夹 # 创建generated文件夹
os.makedirs('./data/generated', exist_ok=True) os.makedirs('./data/generated', exist_ok=True)
generate_qa() generate_qa(interval=storage_interval)