Skip to content

Commit

Permalink
[fundamental][bugfix] Replace retired model "text-ada-001" (#3429)
Browse files Browse the repository at this point in the history
# Description

`"text-ada-001"` retires in 6/18 (reference:
<https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/model-retirements#deprecated-models>),
this PR replaces it with the suggested model.

# All Promptflow Contribution checklist:
- [x] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [x] Pull request includes test coverage for the included changes.
  • Loading branch information
zhengfeiwang committed Jun 18, 2024
1 parent 604f4a4 commit 08cc0d4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/promptflow-executor-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- src/promptflow/promptflow/storage/**
- src/promptflow/tests/*
- src/promptflow/tests/executor/**
- src/promptflow/tests/test_configs/**
- src/promptflow-tracing/promptflow/**
- src/promptflow-core/promptflow/**
- src/promptflow-devkit/promptflow/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from promptflow._sdk._user_agent import USER_AGENT
from promptflow._sdk.entities._trace import Span
from promptflow._utils.logger_utils import get_cli_sdk_logger
from promptflow._utils.user_agent_utils import ClientUserAgentUtil, setup_user_agent_to_operation_context
from promptflow._utils.user_agent_utils import setup_user_agent_to_operation_context
from promptflow.core._errors import MissingRequiredPackage

from .general_utils import convert_time_unix_nano_to_timestamp, json_load
Expand Down Expand Up @@ -347,8 +347,8 @@ class TraceTelemetryHelper:
CUSTOM_DIMENSIONS_TRACE_COUNT = "trace_count"

def __init__(self):
setup_user_agent_to_operation_context(USER_AGENT)
self._user_agent = ClientUserAgentUtil.get_user_agent()
# `setup_user_agent_to_operation_context` will get user agent and return
self._user_agent = setup_user_agent_to_operation_context(USER_AGENT)
self._telemetry_logger = get_telemetry_logger()
self._lock = multiprocessing.Lock()
self._summary: typing.Dict[TraceCountKey, int] = dict()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
'ad585ee1806aae44c095f4b3e473e472bb8be141', (91136, 1272)
'ea48203d881e43bd9e027a19525ba88816c9a639', (92672, 14393)
'e53962d6670e3c446a659b93e8ff5900f82bce76', (107520, 14391)
'b3e2c3c192f72b517f5d32e5f416b1f818922bbd', (122368, 3698)
'17d268bf2d53b839d08502d3a92c6ce0f5e67fdd', (126464, 916)
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
'ad585ee1806aae44c095f4b3e473e472bb8be141', (91136, 1272)
'ea48203d881e43bd9e027a19525ba88816c9a639', (92672, 14393)
'e53962d6670e3c446a659b93e8ff5900f82bce76', (107520, 14391)
'b3e2c3c192f72b517f5d32e5f416b1f818922bbd', (122368, 3698)
'17d268bf2d53b839d08502d3a92c6ce0f5e67fdd', (126464, 916)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def completion(connection: AzureOpenAIConnection, prompt: str, stream: bool) ->
if IS_LEGACY_OPENAI:
completion = openai.Completion.create(
prompt=prompt,
engine="text-ada-001",
engine="gpt-35-turbo-instruct",
max_tokens=256,
temperature=0.8,
top_p=1.0,
Expand All @@ -40,7 +40,7 @@ def completion(connection: AzureOpenAIConnection, prompt: str, stream: bool) ->
else:
completion = get_client(connection).completions.create(
prompt=prompt,
model="text-ada-001",
model="gpt-35-turbo-instruct",
max_tokens=256,
temperature=0.8,
top_p=1.0,
Expand Down

0 comments on commit 08cc0d4

Please sign in to comment.