-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add support for fine-tuning and files using the Azure API. #80
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8d991ed
Add support for fine-tunning and files using the Azure API.
sorinsuciu-msft 8e3c79c
Small changes + version bumps
sorinsuciu-msft 864e3d9
Merge branch 'main' into azure-finetune
sorinsuciu-msft 6fd00f1
Version bump after merge
sorinsuciu-msft 85418f6
fix typo
sorinsuciu-msft 774ed65
adressed comments
sorinsuciu-msft ec704e7
Fixed 2 small issues that cause unit tests to fail.
sorinsuciu-msft f4fa7ea
Adressed comments
sorinsuciu-msft e8deeeb
Merge branch 'main' into azure-finetune
sorinsuciu-msft 33e447a
Version bump
sorinsuciu-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ __pycache__ | |
build | ||
*.egg | ||
.vscode/settings.json | ||
.ipynb_checkpoints | ||
.ipynb_checkpoints | ||
.vscode/launch.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
from urllib.parse import quote_plus | ||
|
||
from openai import error | ||
from openai.api_resources.abstract.api_resource import APIResource | ||
|
||
from openai.util import ApiType | ||
|
||
class DeletableAPIResource(APIResource): | ||
@classmethod | ||
def delete(cls, sid, **params): | ||
def delete(cls, sid, api_type=None, api_version=None, **params): | ||
if isinstance(cls, APIResource): | ||
raise ValueError(".delete may only be called as a class method now.") | ||
url = "%s/%s" % (cls.class_url(), quote_plus(sid)) | ||
return cls._static_request("delete", url, **params) | ||
|
||
base = cls.class_url() | ||
extn = quote_plus(sid) | ||
|
||
typed_api_type, api_version = cls._get_api_type_and_version(api_type, api_version) | ||
if typed_api_type == ApiType.AZURE: | ||
url = "/%s%s/%s?api-version=%s" % (cls.azure_api_prefix, base, extn, api_version) | ||
elif typed_api_type == ApiType.OPEN_AI: | ||
url = "%s/%s" % (base, extn) | ||
else: | ||
raise error.InvalidAPIType('Unsupported API type %s' % api_type) | ||
|
||
return cls._static_request("delete", url, api_type=api_type, api_version=api_version, **params) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.