Skip to content

Commit

Permalink
Adjust gpt caching error logging
Browse files Browse the repository at this point in the history
Signed-off-by: Lucca Baumgärtner <[email protected]>
  • Loading branch information
luccalb committed Feb 5, 2024
1 parent e228a82 commit ce0140f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/database/leads/local_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class LocalRepository(Repository):
BASE_PATH = os.path.dirname(__file__)
DF_INPUT = os.path.abspath(
os.path.join(BASE_PATH, "../../data/sumup_leads_email.csv")
os.path.join(BASE_PATH, "../../data/demo_leads_email.csv")
)
DF_OUTPUT = os.path.abspath(
os.path.join(BASE_PATH, "../../data/leads_enriched.csv")
Expand Down Expand Up @@ -196,6 +196,11 @@ def fetch_gpt_result(self, file_id, operation_name):
try:
with open(json_file_path, "r", encoding="utf-8") as json_file:
data = json.load(json_file)
if operation_name not in data:
log.info(
f"Data for operation {operation_name} was not found in {json_file_path}"
)
return ""
return data[operation_name]
except:
log.warning(f"Error loading GPT results from path {json_file_path}.")
Expand Down

0 comments on commit ce0140f

Please sign in to comment.