Skip to content

Commit 7792415

Browse files
adds valid cache link check which fixes playground error
1 parent c96f42d commit 7792415

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

run_ac.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def save_ac_value(record_id: str, attr_value: Any) -> None:
122122

123123
calculated_attribute_by_record_id[record_id] = attr_value
124124

125-
if data_type == "LLM_RESPONSE":
125+
if data_type == "LLM_RESPONSE" and "http" in CACHE_FILE_UPLOAD_LINK_A2VYBG:
126126
llm_ac_cache[llm_config_hash] = cached_records
127127
requests.put(CACHE_FILE_UPLOAD_LINK_A2VYBG, json=llm_ac_cache)
128128

@@ -218,7 +218,10 @@ def make_batches(
218218

219219
if data_type == "LLM_RESPONSE":
220220
llm_config = attribute_calculators.get_llm_config()
221-
llm_ac_cache = requests.get(CACHE_ACCESS_LINK_A2VYBG).json()
221+
if "http" in CACHE_ACCESS_LINK_A2VYBG:
222+
llm_ac_cache = requests.get(CACHE_ACCESS_LINK_A2VYBG).json()
223+
else:
224+
llm_ac_cache = {}
222225
llm_config_hash = md5(json.dumps(llm_config).encode()).hexdigest()
223226

224227
cached_records = llm_ac_cache.get(llm_config_hash, {})

0 commit comments

Comments
 (0)