Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
Signed-off-by: Elron Bandel <elron.bandel@ibm.com>
  • Loading branch information
elronbandel committed Jan 11, 2024
1 parent 9374a8f commit 0cfacfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ target-version = "py38"
"src/unitxt/operators.py" = ["C901"]
"docs/conf.py" = ["E402"]
"prepare/instructions/models/llama.py" = ["RUF001"]
"utils/hf/prepare_dataset.py" = ["T201"]
"utils/hf/prepare_metric.py" = ["T201"]

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
Expand Down
8 changes: 2 additions & 6 deletions utils/hf/prepare_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@

from huggingface_hub import HfApi

from src.unitxt.logging_utils import get_logger

logger = get_logger()

files = glob.glob("./src/unitxt/*.py")

api = HfApi(token=os.environ["HUGGINGFACE_HUB_TOKEN"])

logger.info("Uploading files from src/unitxt/ to hf:unitxt/data")
print("Uploading files from src/unitxt/ to hf:unitxt/data")

for file in files:
file_name = os.path.basename(file)
Expand All @@ -22,7 +18,7 @@
if file_name == "dataset.py":
file_name = "data.py"

logger.info(f" - {file_name}")
print(f" - {file_name}")

api.upload_file(
path_or_fileobj=file,
Expand Down
8 changes: 2 additions & 6 deletions utils/hf/prepare_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@

from huggingface_hub import HfApi

from src.unitxt.logging_utils import get_logger

logger = get_logger()

files = glob.glob("./src/unitxt/*.py")

api = HfApi(token=os.environ["HUGGINGFACE_HUB_TOKEN"])

logger.info("\nUploading files from src/unitxt/ to hf:unitxt/metric")
print("\nUploading files from src/unitxt/ to hf:unitxt/metric")

for file in files:
file_name = os.path.basename(file)

if file_name == "__init__.py":
continue

logger.info(f" - {file_name}")
print(f" - {file_name}")

api.upload_file(
path_or_fileobj=file,
Expand Down

0 comments on commit 0cfacfa

Please sign in to comment.