-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
FineTuning #453
base: main
Are you sure you want to change the base?
FineTuning #453
Conversation
Refactoring and OpenAI Tuner completed, along with some additional changes to function names. |
TODO: add metrics infrastructure for finetuning Some useful repos: https://github.com/lxe/simple-llm-finetuner, and https://github.com/kuleshov-group/llmtune/tree/main lora.py This links to theirlora.py file, which I believe we intended to at least investigate in the past. (#208)
so this might be a direct solution to that issue too. As the name of the repo suggests, it's meant for consumer grade GPU finetuning, we can surely implement something for CPU too. |
|
||
|
||
def generate_file_path(recording_id: int) -> str: | ||
return f"{recording_id}_processed.jsonl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud: should this file be in /tmp
instead of current dir ? Do we actually need this file permanently ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just pass in a shell command to delete the file that was generated using subprocess
immediately after the file has been uploaded to OpenAI for finetunign. WDYT?
import subprocess | ||
|
||
|
||
class OpenAIFineTuner(FineTuner): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat pick: May be it is a good idea to put a small README.md
file with a few lines of example for documentation.
From a new comer point of view, it is hard to know which method should be called first and which one later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, will add this asap.
condensed_data = self._condense_data(recording) | ||
return condensed_data | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing this. This looks great ! 👍 💯
TODO: add tests, address comments. |
Model used to finetune: Davinci.
expected output:
UPDATE: Need to try fine-tuning the newly available gpt-3.5-turbo-0613 because you can use generate ChatCompletions on it. |
"prompt": "({'name': 'move', 'mouse_x': 354.65234375, 'mouse_y': 130.06640625, 'element_state': {}}, {'title': 'Terminal openadapt \u2014 poetry shell \u25b8 Python \u2014 124\u00d740', 'left': 283, 'top': 109, 'width': 878, 'height': 595, 'window_id': 1129})", | ||
"completion": " ({'name': 'move', 'mouse_x': 356.796875, 'mouse_y': 124.1640625, 'element_state': {}}, {'title': 'Terminal openadapt \u2014 poetry shell \u25b8 Python \u2014 124\u00d740', 'left': 283, 'top': 109, 'width': 878, 'height': 595, 'window_id': 1129})", | ||
}, | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this to tests/assets/fixtures.json or similar?
…cement-Org/OpenAdapt into context_window_reduc
TODO: flake8 errors before merging |
What kind of change does this PR introduce?
addresses #69
Summary
Checklist
How can your code be run and tested?
Other information