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

[Question]: AzureOpenAI error when loading embedding model #1599

Closed
Said-Apollo opened this issue Jul 18, 2024 · 2 comments
Closed

[Question]: AzureOpenAI error when loading embedding model #1599

Said-Apollo opened this issue Jul 18, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Said-Apollo
Copy link

Said-Apollo commented Jul 18, 2024

Describe your problem

Hi, I already have deployed some models and the ada and larg3 embedding models, however, when entering the API-key and endpoint, I'm receiving an error message that the encoding method was not implemented. As far as I know support was added by issue #1512 .
Upon closer insection I saw in the embedding_model.py that there is no encode method for the azure openai class, or was that added somewhere else?

Here the azure class directly inherits from Base
class AzureEmbed(Base): def __init__(self, key, model_name, **kwargs): self.client = AzureOpenAI(api_key=key, azure_endpoint=kwargs["base_url"], api_version="2024-02-01") self.model_name = model_name

And here the Base
`class Base(ABC):
def init(self, key, model_name):
pass

def encode(self, texts: list, batch_size=32):
    raise NotImplementedError("Please implement encode method!")

def encode_queries(self, text: str):
    raise NotImplementedError("Please implement encode method!")`
@Said-Apollo Said-Apollo added the question Further information is requested label Jul 18, 2024
@mapa17
Copy link

mapa17 commented Jul 18, 2024

Looks to me like its derived from the wrong base class. Could try to derive it from OpenAIEmbed. Unfortunately, i dont have an dev env to try it.

@mapa17
Copy link

mapa17 commented Jul 18, 2024

I can confirm that changing the base class to OpenAIEmbed works. I am able to use my azure deployed endpoinds with them. As an additional note the name of the endpoints must be:

  • azure-text-embedding-3-large
  • azure-gpt-35-turbo

and similar, so azure- followed by the model type.

KevinHuSh added a commit that referenced this issue Jul 19, 2024
### What problem does this PR solve?

#1599

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
KevinHuSh added a commit that referenced this issue Sep 26, 2024
### What problem does this PR solve?

#1599

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Halfknow pushed a commit to Halfknow/ragflow that referenced this issue Nov 11, 2024
### What problem does this PR solve?

infiniflow#1599

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Halfknow pushed a commit to Halfknow/ragflow that referenced this issue Nov 11, 2024
### What problem does this PR solve?

infiniflow#1599

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants