microsoft / SynapseML

Simple and Distributed Machine Learning
http://aka.ms/spark
MIT License
5.05k stars 830 forks source link

[BUG]Unable to import name 'OpenAIEmbedding' from 'synapse.ml.cognitive' #1872

Open jyravi opened 1 year ago

jyravi commented 1 year ago

SynapseML version

0.11.0

System information

Describe the problem

I am trying to create OpenAI Embedding as shown in the notebook - CognitiveServices - OpenAI.ipynb.

Code to reproduce issue

from synapse.ml.cognitive import OpenAIEmbedding

embedding = ( OpenAIEmbedding() .setSubscriptionKey(key) .setDeploymentName(deployment_name_embeddings) .setUrl("https://{}.openai.azure.com/".format(service_name)) .setTextCol("combined") .setErrorCol("error") .setOutputCol("embeddings") )

Other info / logs

No response

What component(s) does this bug affect?

What language(s) does this bug affect?

What integration(s) does this bug affect?

github-actions[bot] commented 1 year ago

Hey @jyravi :wave:! Thank you so much for reporting the issue/feature request :rotating_light:. Someone from SynapseML Team will be looking to triage this issue soon. We appreciate your patience.

serena-ruan commented 1 year ago

Hi @jyravi Could you please double check if your SynpaseML version is v0.11.0? You could check by running:

import synapse.ml.core
synapse.ml.core.__spark_package_version__
rabbyn commented 1 year ago

Hello @serena-ruan , I'm facing the same error while using a fresh Synapse Spark Cluster I just deployed. By running the command you gave to @jyravi I got '0.10.1-69-84f5b579-SNAPSHOT' . So it seems that the SynapseML version currently deployed on Synapse Resource is not up-to-date to fully use Azure Open AI 👎

Support request ID | 2304070050000707

image

image

anoopsr1 commented 1 year ago

This seems to be still a problem "ImportError: cannot import name 'OpenAIEmbedding' from 'synapse.ml.cognitive' (/home/trusted-service-user/cluster-env/env/lib/python3.10/site-packages/synapse/ml/cognitive/init.py)"