obtain_missing_id_jsonl
get_ids
Loop through the jsonl file and return a list of ids.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
The path to the jsonl file |
required |
id_name
|
str
|
The name of the id field in the jsonl file, by default “id” |
'id'
|
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of ids |
Source code in src/prompto/scripts/obtain_missing_id_jsonl.py
obtain_missing_jsonl
obtain_missing_jsonl(
input_file: str,
output_file: str,
new_experiment_file: str,
id_name: str = "id",
) -> None
Loops through the input_file and checks if the id is in the output_file. If it is not, then it adds the line to the new_experiment_file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_file
|
str
|
Path to input jsonl experiment file with prompts |
required |
output_file
|
str
|
Path to output jsonl file with prompts |
required |
new_experiment_file
|
str
|
Path to new jsonl experiment file with prompts that were missing in the output_file |
required |
id_name
|
str
|
The name of the id field in the jsonl file, by default “id” |
'id'
|