Skip to content

Commit

Permalink
Fix sleep for embeddings call (#346)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Widder <sawidder@microsoft.com>
  • Loading branch information
sarah-widder and sarah-widder authored Oct 27, 2023
1 parent 354b62b commit 32dcaab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/data_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Data utilities for index preparation."""
import ast
from asyncio import sleep
import html
import json
import os
Expand All @@ -9,6 +8,7 @@
import openai
import re
import tempfile
import time
from abc import ABC, abstractmethod
from concurrent.futures import ProcessPoolExecutor
from dataclasses import dataclass
Expand Down Expand Up @@ -735,7 +735,7 @@ def chunk_content(
doc.contentVector = get_embedding(chunk, azure_credential=azure_credential, embedding_model_endpoint=embedding_endpoint)
break
except:
sleep(30)
time.sleep(30)
if doc.contentVector is None:
raise Exception(f"Error getting embedding for chunk={chunk}")

Expand Down

0 comments on commit 32dcaab

Please sign in to comment.