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

Validator, logging and modelling improvements #127

Merged
merged 14 commits into from
Jan 29, 2024
Merged

Conversation

MartBakler
Copy link
Collaborator

@MartBakler MartBakler commented Jan 23, 2024

Fixed a bug regarding lists of pydantic objects in validator
Added a lot of logging

@MartBakler MartBakler changed the title fixed a bug regarding lists of pydantic objects Pydantic and validator bugfixes Jan 24, 2024
@MartBakler MartBakler changed the title Pydantic and validator bugfixes Validator and logging additions Jan 24, 2024
@MartBakler MartBakler marked this pull request as ready for review January 24, 2024 13:39
@MartBakler MartBakler changed the title Validator and logging additions Validator, logging and modelling additions Jan 25, 2024
@MartBakler MartBakler changed the title Validator, logging and modelling additions Validator, logging and modelling improvements Jan 25, 2024
Copy link
Contributor

@JackHopkins JackHopkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya, I've left a few questions that we should go through.

@@ -453,6 +455,9 @@ def _check_finetuning_condition(self, func_hash):
# if havent read in the patch dataset size, read it in
patch_dataset_size = self._get_dataset_info(PATCHES, func_hash, type="length")
self.dataset_sizes[PATCHES][func_hash] = patch_dataset_size
logging.info(f"Function {function_description.__name__} [{align_dataset_size} aligns | {patch_dataset_size} runs] will be finetuned from"\
f" {self.function_configs[func_hash].teacher_models.model_name} using {self.function_configs[func_hash].distilled_model.provider} in"\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't teacher_models a list? If so, how can you get model_name from it?

@@ -129,20 +136,27 @@ def get_generation_case(self, args, kwargs, function_description, llm_parameters
# no examples needed, using a finetuned model. Dont save to finetune dataset
if is_distilled_model and suitable_for_distillation:
prompt = self.construct_prompt(f, args, kwargs, [], distilled_model)
if func_hash not in self.current_generators:
self.current_generators[func_hash] = {"model": "finetuned_model_placeholder", "examples": []}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a placeholder?

return prompt, distilled_model, suitable_for_distillation, True

else:
aligns = self.function_modeler.get_symbolic_alignments(function_description.__hash__(), max=16)
examples = [f"Inputs:\nArgs: {align['args']}\nKwargs: {align['kwargs']}\nOutput: {align['output']}" for align in
aligns]

if func_hash not in self.current_generators:
self.current_generators[func_hash] = {"model": "", "examples": examples}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the variable name current_generators to something more intuitive?

context_length = 128000,
instructions="You are given below a function description and input data. The function description of what the function must carry out can be found in the Function section, with input and output type hints. The input data can be found in Input section. Using the function description, apply the function to the Input and return a valid output type, that is acceptable by the output_class_definition and output_class_hint.\nINCREDIBLY IMPORTANT: Only output a JSON-compatible string in the correct response format. Use the [END] tokens to specify when the output ends.",
parsing_helper_tokens={"start_token": "[START]", "end_token": "[END]"}),
"gpt-3.5-turbo-1106-finetune": OpenAIConfig(model_name = "", context_length = 14000),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the model_name empty?

finetuning_response: FineTuningJob = self.client.fine_tuning.jobs.create(training_file=training_file_id,
model="gpt-3.5-turbo",
finetuning_response: FineTuningJob = self.client.fine_tuning.jobs.create(training_file=training_file_id,
model="gpt-3.5-turbo-1106",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this model hardcoded?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MartBakler MartBakler merged commit 21672ec into master Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants