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

.Net: Issue-2839: Fixed .NET notebook '07-DALL-E-2' errors #3065

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

Roybott
Copy link
Contributor

@Roybott Roybott commented Oct 3, 2023

Motivation and Context

Running the .NET notebook '07-DALL-E-2' using OpenAI had 2 errors breaking the experience for new developers.

Description

  1. The configuration attempted to use the chat mode 'gpt-3.5-turbo' but with a Text completion service. This was fixed by changing the model to 'text-davinci-003' (as is stated in the description above the code box anyway).

  2. The embedding comparison code used an extension 'AsReadOnlySpan()' which does not exist for a ReadOnlyMemory which is what is returned by the OpenAI Embedding Generation Service. Fix this by changing it to just access the 'span' that already exists on the ReadOnlyMemory

Contribution Checklist

Fixed embedding compare code in .NET notebook 07
@Roybott Roybott requested a review from a team as a code owner October 3, 2023 21:35
@shawncal shawncal added the .NET Issue or Pull requests regarding .NET code label Oct 3, 2023
@github-actions github-actions bot changed the title Issue-2839: Fixed .NET notebook '07-DALL-E-2' errors .Net: Issue-2839: Fixed .NET notebook '07-DALL-E-2' errors Oct 3, 2023
@dmytrostruk dmytrostruk added this pull request to the merge queue Oct 4, 2023
Merged via the queue into microsoft:main with commit 614f9a0 Oct 4, 2023
19 checks passed
SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request Nov 1, 2023
…#3065)

### Motivation and Context
Running the .NET notebook '07-DALL-E-2' using OpenAI had 2 errors
breaking the experience for new developers.

### Description

1. The configuration attempted to use the **chat** mode 'gpt-3.5-turbo'
but with a **Text** completion service. This was fixed by changing the
model to 'text-davinci-003' (as is stated in the description above the
code box anyway).

2. The embedding comparison code used an extension 'AsReadOnlySpan()'
which does not exist for a ReadOnlyMemory<float> which is what is
returned by the OpenAI Embedding Generation Service. Fix this by
changing it to just access the 'span' that already exists on the
ReadOnlyMemory<float>

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.Net: 07-DALL-E-2 Notebook in dotnet contains error in code when creating Kernel
4 participants