Hi,
I have faced an error in the training model procedure. the model uses GPT-4 to extract the embeddings. Here is the snippet code I used and the code error:
for attempt in range(self.retries):
try:
response = openai.Embedding.create(
model=“text-embedding-ada-002”, # Specify the model for embeddings
input=text,
timeout=self.timeout # Set timeout parameter
)
break # Break the loop if successful
except openai.error.Timeout as e:
print(f"Timeout occurred on attempt {attempt + 1}/{self.retries}. Retrying after {self.wait_time} seconds…“)
time.sleep(self.wait_time) # Wait before retrying
except Exception as e:
print(f"An error occurred: {e}”)
if attempt + 1 == self.retries:
raise e # Re-raise the error if retries are exhausted
# Convert embeddings list to a tensor
embeddings = torch.tensor(response['data'][0]['embedding'], dtype=torch.float)
The error:
500 {‘error’: {‘message’: ‘internal error’, ‘type’: ‘quota_error’, ‘param’: None, ‘code’: None}} {‘Date’: ‘Fri, 27 Sep 2024 14:57:10 GMT’, ‘Content-Type’: ‘application/json; charset=utf-8’, ‘Content-Length’: ‘137’, ‘Connection’: ‘keep-alive’, ‘vary’: ‘Origin’, ‘x-request-id’: ‘req_4e9dea115c7619b13d84bc744b6c7f52’, ‘strict-transport-security’: ‘max-age=31536000; includeSubDomains; preload’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8c9c58304d0a663e-AMS’}
An error occurred: internal error {
“error”: {
“message”: “internal error”,
“type”: “quota_error”,
“param”: null,
“code”: null
}
}