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

fix param definition #424

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion data_juicer/ops/mapper/extract_qa_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ExtractQAMapper(Mapper):

def __init__(self,
hf_model: str = 'alibaba-pai/pai-qwen1_5-7b-doc2qa',
trust_remote_code=False,
trust_remote_code: bool = False,
pattern: str = None,
qa_format: str = 'chatml',
enable_vllm: bool = True,
Expand Down
10 changes: 7 additions & 3 deletions data_juicer/ops/mapper/generate_instruction_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class GenerateInstructionMapper(Mapper):
_accelerator = 'cuda'

def __init__(self,
hf_model,
seed_file,
instruct_num,
hf_model: str = 'Qwen/Qwen-7B-Chat',
seed_file: str = None,
drcege marked this conversation as resolved.
Show resolved Hide resolved
instruct_num: int = 3,
trust_remote_code: bool = False,
similarity_threshold: float = 0.7,
prompt_template: str = None,
Expand Down Expand Up @@ -111,6 +111,10 @@ def __init__(self,
super().__init__(*args, **kwargs)
self.num_proc = 1

if not seed_file:
raise ValueError('Please provide `seed_file` parameter, a file in chatml format. '\
'Reference data: data-juicer/demos/data/demo-dataset-chatml.jsonl ')

self.instruct_num = instruct_num
self.similarity_threshold = similarity_threshold
self.similarity_type = 'rouge_l'
Expand Down
Loading