Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanmai committed Dec 3, 2024
1 parent b3b58a8 commit e533980
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/helm/benchmark/config_registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from importib import resources
from importlib import resources

from helm.benchmark.model_deployment_registry import register_model_deployments_from_path
from helm.benchmark.model_metadata_registry import register_model_metadata_from_path
Expand Down
2 changes: 1 addition & 1 deletion src/helm/benchmark/metrics/efficiency_metrics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Dict, List, Optional

import json
from importib import resources
from importlib import resources

from helm.common.hierarchical_logger import hlog
from helm.benchmark.adaptation.request_state import RequestState
Expand Down
2 changes: 1 addition & 1 deletion src/helm/benchmark/presentation/contamination.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from typing import List, Optional
import dacite
from importib import resources
from importlib import resources
import yaml

from helm.common.hierarchical_logger import htrack, hlog
Expand Down
6 changes: 3 additions & 3 deletions src/helm/benchmark/presentation/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from inspect import cleandoc
import mako.template
import yaml
from importib import resources
from importlib import resources

from helm.common.general import hlog
from helm.benchmark.metrics.metric_name import MetricName
Expand Down Expand Up @@ -238,7 +238,7 @@ def get_adapter_fields() -> List[Field]:
# Unfortunately there is no standard library support for getting docstrings of class fields,
# so we have to do the parsing outselves. Fortunately, the parsing is quite straightforward.
adapter_spec_path = resources.files(_ADAPTER_SPEC_PACKAGE).joinpath(_ADAPTER_SPEC_FILENAME)
with open(adapter_spec_path, "r") as f:
with adapter_spec_path.open("r") as f:
contents = f.read()
module_node = ast.parse(contents)
adapter_spec_node = [
Expand Down Expand Up @@ -271,7 +271,7 @@ def get_adapter_fields() -> List[Field]:


def get_default_schema_path() -> str:
return resources.files(SCHEMA_YAML_PACKAGE).joinpath(SCHEMA_CLASSIC_YAML_FILENAME)
return str(resources.files(SCHEMA_YAML_PACKAGE).joinpath(SCHEMA_CLASSIC_YAML_FILENAME))


def read_schema(schema_path: str) -> Schema:
Expand Down
2 changes: 1 addition & 1 deletion src/helm/benchmark/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import argparse
from importib import resources
from importlib import resources
import json
from os import path
import urllib
Expand Down
2 changes: 1 addition & 1 deletion src/helm/tokenizers/yalm_tokenizer_data/yalm_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mypy: check_untyped_defs = False
from importib import resources
from importlib import resources

from helm.common.optional_dependencies import handle_module_not_found_error

Expand Down

0 comments on commit e533980

Please sign in to comment.