Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklundquist committed Jan 22, 2025
1 parent 3632593 commit 0eec61f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions clarifai/runners/models/model_upload.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import json
import os
import re
import sys
import tarfile
import time
from string import Template

import requests
import yaml
from clarifai_grpc.grpc.api import resources_pb2, service_pb2
from clarifai_grpc.grpc.api.status import status_code_pb2
Expand All @@ -22,6 +20,7 @@
from clarifai.urls.helper import ClarifaiUrlHelper
from clarifai.utils.logging import logger


def _clear_line(n: int = 1) -> None:
LINE_UP = '\033[1A' # Move cursor up one line
LINE_CLEAR = '\x1b[2K' # Clear the entire line
Expand All @@ -30,7 +29,7 @@ def _clear_line(n: int = 1) -> None:


class ModelUploader:
DEFAULT_CHECKPOINT_SIZE = 50*1024**3 # 50 GiB
DEFAULT_CHECKPOINT_SIZE = 50 * 1024**3 # 50 GiB

def __init__(self, folder: str, validate_api_ids: bool = True, download_validation_only=False):
"""
Expand Down Expand Up @@ -597,6 +596,7 @@ def monitor_model_build(self):
f"\nModel build failed with status: {resp.model_version.status} and response {resp}")
return False


def main(folder, download_checkpoints, skip_dockerfile):
uploader = ModelUploader(folder)
if download_checkpoints:
Expand Down
6 changes: 3 additions & 3 deletions clarifai/runners/utils/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import importlib.util
import json
import os
import requests
import shutil
import subprocess

import requests

from clarifai.utils.logging import logger


Expand Down Expand Up @@ -196,6 +197,5 @@ def get_huggingface_checkpoint_total_size(repo_name):
total_size += file['size']
return total_size
except Exception as e:
logger.error(
f"Error fetching checkpoint size from huggingface.co: {e}")
logger.error(f"Error fetching checkpoint size from huggingface.co: {e}")
return 0

0 comments on commit 0eec61f

Please sign in to comment.