microsoft / PubSec-Info-Assistant

Information Assistant, built with Azure OpenAI Service, Industry Accelerator
MIT License
319 stars 677 forks source link

Error: 500: Failed to embed #755

Closed ianwilk20 closed 2 months ago

ianwilk20 commented 3 months ago

Bug Details

Describe the bug When uploading a .xlsx, .csv or .tsv file and it is processed, a "Error: 500: Failed to embed" is eventually received.

Steps To Reproduce

  1. On the landing page of the "PubSec-Info-Assistant-TEST" click "Manage Content"
  2. Create a new folder
  3. Create a new tag
  4. Select your .xlsx, .csv or .tsv file
  5. Choose to upload the file
  6. Click on "Upload Status"
  7. Wait around 5-10 minutes
  8. See that this error is displayed in the "Status Detail" column: An error occurred, max requeue limit was reached. Error description: 500: Failed to embed: RetryError[<Future at 0x7937f0506140 state=finished raised BadRequestError>]

What is the expected behavior? For the embeddings to work on any file types that are displayed on the Manage Content -> Upload Files page

Logs "status_updates": [ { "status": "File uploaded from browser to Azure Blob Storage", "status_timestamp": "2024-06-12 17:44:57", "status_classification": "Info" }, { "status": "FileUploadedFunc - csv file sent to submit queue. Visible in 144 seconds", "status_timestamp": "2024-06-12 17:45:10", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - Starting to parse the non-PDF file", "status_timestamp": "2024-06-12 17:47:55", "status_classification": "Info" }, { "status": "FileLayoutParsingOther - Message received from non-pdf submit queue", "status_timestamp": "2024-06-12 17:47:55", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - SAS token generated to access the file", "status_timestamp": "2024-06-12 17:47:55", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - partitioning complete", "status_timestamp": "2024-06-12 17:47:56", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - chunking complete. 228 chunks created", "status_timestamp": "2024-06-12 17:47:56", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - chunking stored.", "status_timestamp": "2024-06-12 17:48:05", "status_classification": "Debug" }, { "status": "FileLayoutParsingOther - message sent to enrichment queue", "status_timestamp": "2024-06-12 17:48:05", "status_classification": "Debug" }, { "status": "TextEnrichment - Received message from text-enrichment-queue ", "status_timestamp": "2024-06-12 17:48:41", "status_classification": "Debug" }, { "status": "TextEnrichment - detected language of text is en.", "status_timestamp": "2024-06-12 17:48:42", "status_classification": "Debug" }, { "status": "TextEnrichment - Text enrichment is complete, message sent to embeddings queue", "status_timestamp": "2024-06-12 17:51:34", "status_classification": "Debug" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 17:52:32", "status_classification": "Info" }, { "status": "Message requeued to embeddings queue, attempt 1. Visible in 60 seconds. Error: 500: Failed to embed: RetryError[<Future at 0x7937ee800880 state=finished raised BadRequestError>].", "status_timestamp": "2024-06-12 17:57:37", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 445, in poll_queue\n statusLog.upsert_document(blob_path, f'Message requeued to embeddings queue, attempt {str(requeue_count)}. Visible in {str(backoff)} seconds. Error: {str(error)}.',\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937ee800880 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937ee800880 state=finished raised BadRequestError>]\n" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 17:59:40", "status_classification": "Info" }, { "status": "Message requeued to embeddings queue, attempt 2. Visible in 202 seconds. Error: 500: Failed to embed: RetryError[<Future at 0x7937f053b340 state=finished raised BadRequestError>].", "status_timestamp": "2024-06-12 18:03:51", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 445, in poll_queue\n statusLog.upsert_document(blob_path, f'Message requeued to embeddings queue, attempt {str(requeue_count)}. Visible in {str(backoff)} seconds. Error: {str(error)}.',\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937f053b340 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937f053b340 state=finished raised BadRequestError>]\n" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 18:08:07", "status_classification": "Info" }, { "status": "Message requeued to embeddings queue, attempt 3. Visible in 411 seconds. Error: 500: Failed to embed: RetryError[<Future at 0x7937ee7bb100 state=finished raised BadRequestError>].", "status_timestamp": "2024-06-12 18:12:18", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 445, in poll_queue\n statusLog.upsert_document(blob_path, f'Message requeued to embeddings queue, attempt {str(requeue_count)}. Visible in {str(backoff)} seconds. Error: {str(error)}.',\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937ee7bb100 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937ee7bb100 state=finished raised BadRequestError>]\n" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 18:20:38", "status_classification": "Info" }, { "status": "Message requeued to embeddings queue, attempt 4. Visible in 278 seconds. Error: 500: Failed to embed: RetryError[<Future at 0x7937ee2717b0 state=finished raised BadRequestError>].", "status_timestamp": "2024-06-12 18:24:50", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 445, in poll_queue\n statusLog.upsert_document(blob_path, f'Message requeued to embeddings queue, attempt {str(requeue_count)}. Visible in {str(backoff)} seconds. Error: {str(error)}.',\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937ee2717b0 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937ee2717b0 state=finished raised BadRequestError>]\n" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 18:30:18", "status_classification": "Info" }, { "status": "Message requeued to embeddings queue, attempt 5. Visible in 1410 seconds. Error: 500: Failed to embed: RetryError[<Future at 0x7937ee6e6560 state=finished raised BadRequestError>].", "status_timestamp": "2024-06-12 18:34:31", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 445, in poll_queue\n statusLog.upsert_document(blob_path, f'Message requeued to embeddings queue, attempt {str(requeue_count)}. Visible in {str(backoff)} seconds. Error: {str(error)}.',\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937ee6e6560 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937ee6e6560 state=finished raised BadRequestError>]\n" }, { "status": "Embeddings process started with model azure-openai_text-embedding-ada-002", "status_timestamp": "2024-06-12 18:58:13", "status_classification": "Info" }, { "status": "An error occurred, max requeue limit was reached. Error description: 500: Failed to embed: RetryError[<Future at 0x7937f0506140 state=finished raised BadRequestError>]", "status_timestamp": "2024-06-12 19:02:24", "status_classification": "Error", "stack_trace": "Traceback (most recent call last):\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 973, in _bootstrap\n self._bootstrap_inner()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n self.run()\n File \"/opt/python/3.10.13/lib/python3.10/threading.py\", line 953, in run\n self._target(*self._args, **self._kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 274, in poll_queue_thread\n poll_queue()\n File \"/tmp/8dc8a40665c118d/app.py\", line 450, in poll_queue\n statusLog.upsert_document(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 382, in __call__\n result = fn(*args, **kwargs)\n File \"/tmp/8dc8a40665c118d/app.py\", line 91, in encode\n response = client.embeddings.create(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/resources/embeddings.py\", line 113, in create\n return self._post(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1233, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 922, in request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 998, in _request\n return self._retry_request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1046, in _retry_request\n return self._request(\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/openai/_base_client.py\", line 1013, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.BadRequestError: Error code: 400 - {'error': {'message': \"This model's maximum context length is 8192 tokens, however you requested 155434 tokens (155434 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 234, in embed_texts\n embeddings = model_obj.encode(texts)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 289, in wrapped_f\n return self(f, *args, **kw)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 379, in __call__\n do = self.iter(retry_state=retry_state)\n File \"/tmp/8dc8a40665c118d/antenv/lib/python3.10/site-packages/tenacity/__init__.py\", line 326, in iter\n raise retry_exc from fut.exception()\ntenacity.RetryError: RetryError[<Future at 0x7937f0506140 state=finished raised BadRequestError>]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/tmp/8dc8a40665c118d/app.py\", line 383, in poll_queue\n embedding = embed_texts(target_embeddings_model, [text])\n File \"/tmp/8dc8a40665c118d/app.py\", line 249, in embed_texts\n raise HTTPException(status_code=500, detail=f\"Failed to embed: {str(error)}\") from error\nfastapi.exceptions.HTTPException: 500: Failed to embed: RetryError[<Future at 0x7937f0506140 state=finished raised BadRequestError>]\n" } ]

Information Assistant details

Please provide the following details. You can simply include a screenshot of your Info panel as well.

GitHub branch: [main]

Version or Latest commit: [commit e60ed3e6dced43796a96d9b2115b4c283872a0eb]

What region is your Azure Open AI Service in? [East US]

What ChatGPT model are you using?

model name: [gpt-35-turbo-16k]

model version: [0613]

What embeddings model are you using? [text-embedding-ada-002]

Additional context N/A

If the bug is confirmed, would you be willing to submit a PR?

georearl commented 3 months ago

The error is this... "This model's maximum context length is 8192 tokens, however you requested 155434 tokens". This would appear to be the result of the chunking stage failing to split your file. The file type is csv. CSV's are chunked by the unstructured.io library. A few months ago we discovered that csv's were failing to be chunked by the library, at which point we upgraded the library we used, which fixed the issue. Can you confirm when you pulled and deployed the code from GitHub and deployed?

Also check this line in the file functions>requirements.txt shows this...

unstructured[csv,doc,docx,email,html,md,msg,ppt,pptx,text,xlsx,xml] == 0.12.5

dayland commented 2 months ago

This issue is marked for closure due to inactivity for 2 weeks. It will be closed in 5 days.

dayland commented 2 months ago

closing due to inactivity