Skip to content

Commit

Permalink
[fix] olmo model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
huyiwen committed Aug 6, 2024
1 parent 0c25953 commit def3be9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utilization/model/huggingface_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ def __init__(self, args: ModelArguments):
except TypeError:
logger.warning(f"Cannot set `position_ids` for {self.name}. Set `support_position_ids` to False.")
self.support_position_ids = False
except ValueError:
except Exception:
self.support_position_ids = True

try:
self.model(use_cache=True, past_key_values=None)
except TypeError:
logger.warning(f"Cannot set `use_cache` for {self.name}. Set `support_cache` to False.")
self.support_cache = False
except ValueError:
except Exception:
self.support_cache = True

self.support_cache = self.support_cache and args.prefix_caching is True
Expand Down

0 comments on commit def3be9

Please sign in to comment.