-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Extract fine-tuning operations into separate methods for better modul… #44060
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR refactors the fine-tuning sample code by extracting inline operations into separate, reusable methods for better modularity. The main function is streamlined by commenting out most operation calls, allowing users to selectively test specific functionalities.
- Extracted 7 fine-tuning operations into dedicated methods (pause, resume, deploy_and_inference, list_jobs, list_events, list_checkpoints, cancel, retrieve)
- Simplified the main function by replacing inline code with commented calls to the extracted methods
- Applied the same refactoring pattern consistently to both synchronous and asynchronous versions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sample_finetuning_supervised_job_async.py | Extracted async fine-tuning operations into separate methods and simplified main() with commented method calls |
| sample_finetuning_supervised_job.py | Extracted sync fine-tuning operations into separate methods and simplified main() with commented method calls |
sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py
Show resolved
Hide resolved
| print(resumed_job) | ||
|
|
||
|
|
||
| async def deploy_and_inference(openai_client, credential, job_id): |
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.
@jayesh-tanna Can we separate deployment and inference in different methods also in both the files?
…arity
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines