Skip to content

Commit

Permalink
local models first
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya52 committed Dec 20, 2024
1 parent 47dd9fa commit a675fef
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions refact_utils/finetune/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ def _add_results_for_passthrough_provider(provider: str) -> None:
if 'completion' in v.get('filter_caps', []):
result['completion'].append(k)

for k, v in data.get("model_assign", {}).items():
if model_dict := [d for d in data['models'] if d['name'] == k]:
model_dict = model_dict[0]

add_result(k, model_dict)

if not model_dict.get('has_finetune'):
continue

finetune_info = model_dict.get('finetune_info', []) or []
for run in finetune_info:
val = f"{k}:{run['run_id']}:{run['checkpoint']}"
add_result(val, model_dict)

if data.get("openai_api_enable"):
_add_results_for_passthrough_provider('openai')

Expand All @@ -121,20 +135,6 @@ def _add_results_for_passthrough_provider(provider: str) -> None:
if data.get('xai_api_enable'):
_add_results_for_passthrough_provider('xai')

for k, v in data.get("model_assign", {}).items():
if model_dict := [d for d in data['models'] if d['name'] == k]:
model_dict = model_dict[0]

add_result(k, model_dict)

if not model_dict.get('has_finetune'):
continue

finetune_info = model_dict.get('finetune_info', []) or []
for run in finetune_info:
val = f"{k}:{run['run_id']}:{run['checkpoint']}"
add_result(val, model_dict)

return result


Expand Down

0 comments on commit a675fef

Please sign in to comment.