Skip to content

Commit 8a3f2d8

Browse files
authored
Fix HF integration for Python < 3.10 (#426)
1 parent 49c8647 commit 8a3f2d8

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
gpu_tests:
105105
name: GPU Tests
106106
runs-on: ubuntu-latest
107-
timeout-minutes: 15
107+
timeout-minutes: 8
108108
env:
109109
BEAKER_TOKEN: ${{ secrets.BEAKER_TOKEN }}
110110
BEAKER_IMAGE: olmo-torch2-test

.github/workflows/pr_checks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- main
1111
paths:
1212
- 'olmo/**'
13+
- 'hf_olmo/**'
1314

1415
jobs:
1516
changelog:

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Fixed
11+
12+
- 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.
13+
1014
## [v0.2.3](https://github.com/allenai/OLMo/releases/tag/v0.2.3) - 2024-01-31
1115

1216
## [v0.2.2](https://github.com/allenai/LLM/releases/tag/v0.2.2) - 2023-12-10

hf_olmo/modeling_olmo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from dataclasses import fields
12
from typing import List, Optional, Tuple, Union
23

34
import torch
@@ -17,8 +18,8 @@ def create_model_config_from_pretrained_config(config: OLMoConfig):
1718
"""
1819

1920
kwargs = {}
20-
for key in ModelConfig.__match_args__:
21-
kwargs[key] = getattr(config, key)
21+
for field in fields(ModelConfig):
22+
kwargs[field.name] = getattr(config, field.name)
2223

2324
model_config = ModelConfig(**kwargs)
2425
return model_config

0 commit comments

Comments
 (0)