Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] olmo model loading #279

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading