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 HF integration for Python < 3.10 #426

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
gpu_tests:
name: GPU Tests
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 8
env:
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN }}
BEAKER_IMAGE: olmo-torch2-test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- main
paths:
- 'olmo/**'
- 'hf_olmo/**'

jobs:
changelog:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Fixed an issue with the HuggingFace integration where we were inadvertently using a feature that was introduced in Python 3.10, causing an error for older Python versions.

## [v0.2.3](https://github.com/allenai/OLMo/releases/tag/v0.2.3) - 2024-01-31

## [v0.2.2](https://github.com/allenai/LLM/releases/tag/v0.2.2) - 2023-12-10
Expand Down
5 changes: 3 additions & 2 deletions hf_olmo/modeling_olmo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from dataclasses import fields
from typing import List, Optional, Tuple, Union

import torch
Expand All @@ -17,8 +18,8 @@ def create_model_config_from_pretrained_config(config: OLMoConfig):
"""

kwargs = {}
for key in ModelConfig.__match_args__:
kwargs[key] = getattr(config, key)
for field in fields(ModelConfig):
kwargs[field.name] = getattr(config, field.name)

model_config = ModelConfig(**kwargs)
return model_config
Expand Down
Loading