Skip to content

Commit

Permalink
fix: update ChatGenerationModelAdapter get strategy. (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Shi authored May 23, 2024
1 parent 87ee035 commit 3d30e0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llmuses/models/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ def __init__(self,
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
logger.warning(f'**Device: {self.device}')

self.generation_config = model_cfg.pop('generation_config', None)
self.generation_template = model_cfg.pop('generation_template', None)
self.generation_config = model_cfg.get('generation_config', None)
self.generation_template = model_cfg.get('generation_template', None)

if self.generation_config is None or self.generation_template is None:
raise ValueError('generation_config or generation_template is required for chat generation.')
Expand Down

0 comments on commit 3d30e0b

Please sign in to comment.