Azure OpenAI Samples is a collection of code samples illustrating how to use Azure Open AI in creating AI solution for various use cases across industries. This repository is mained by a community of volunters. We welcomed your contributions.
MIT License
543
stars
387
forks
source link
Script Error in azure-openai-samples/use_cases/movie_reviews/notebooks/01-get-embeddings.ipynb #10
Hello
azure-openai-samples/use_cases/movie_reviews/notebooks/01-get-embeddings.ipynb Below is the script that I have executed and getting a below error message.
Error:AttributeError: module 'asyncio' has no attribute 'coroutine'
Could you please take a look and do the needful Thanks.
Below is the script.
from ratelimiter import RateLimiter
@RateLimiter(max_calls=50, period=60) # Published limit is 120 requests per minute, at the time of development, only 50 requests per minute is possible.
def request_api(df, deployment_id, i):
try:
input = 'Movie title: ' + df['Movie'][i] + '\n' + df['Review'][i]
embedding = openai.Embedding.create(input=input, deployment_id=deployment_id)
df['embedding'].iloc[i] = embedding['data'][0]['embedding']
except Exception as err:
print(i)
print(f"Unexpected {err=}, {type(err)=}")
Hello azure-openai-samples/use_cases/movie_reviews/notebooks/01-get-embeddings.ipynb Below is the script that I have executed and getting a below error message.
Error: AttributeError: module 'asyncio' has no attribute 'coroutine' Could you please take a look and do the needful Thanks.
Below is the script. from ratelimiter import RateLimiter
@RateLimiter(max_calls=50, period=60) # Published limit is 120 requests per minute, at the time of development, only 50 requests per minute is possible. def request_api(df, deployment_id, i): try: input = 'Movie title: ' + df['Movie'][i] + '\n' + df['Review'][i] embedding = openai.Embedding.create(input=input, deployment_id=deployment_id) df['embedding'].iloc[i] = embedding['data'][0]['embedding'] except Exception as err: print(i) print(f"Unexpected {err=}, {type(err)=}")