Skip to content

Commit

Permalink
set task if the passed metadata does not include task
Browse files Browse the repository at this point in the history
  • Loading branch information
wenfeiy-db committed Nov 3, 2023
1 parent 6c41241 commit 5872f3f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llmfoundry/callbacks/hf_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def __init__(
if self.mlflow_registered_model_name is not None:
# Both the metadata and the task are needed in order for mlflow
# and databricks optimized model serving to work
if 'metadata' not in mlflow_logging_config:
mlflow_logging_config['metadata'] = {
'task': 'llm/v1/completions'
}
if 'task' not in mlflow_logging_config:
mlflow_logging_config['task'] = 'text-generation'
default_metadata = {
'task': 'llm/v1/completions'
}
passed_metadata = mlflow_logging_config.get('metadata', {})
mlflow_logging_config['metadata'] = {**default_metadata, **passed_metadata}
mlflow_logging_config.setdefault('task', 'text-generation')
self.mlflow_logging_config = mlflow_logging_config

self.huggingface_folder_name_fstr = os.path.join(
Expand Down

0 comments on commit 5872f3f

Please sign in to comment.