Skip to content

Commit

Permalink
- Blacken the code
Browse files Browse the repository at this point in the history
  • Loading branch information
regiellis committed Aug 28, 2024
1 parent bcff1ec commit a5a6b18
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion civitai_models_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def load_environment_variables() -> None:
env_path = Path(path).expanduser().resolve()
if env_path.is_file():
load_dotenv(env_path)
#feedback_message(f"Loaded environment variables from {env_path}", "info")
# feedback_message(f"Loaded environment variables from {env_path}", "info")
return

# If .env file is not found, provide detailed feedback
Expand Down
3 changes: 2 additions & 1 deletion civitai_models_manager/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def explain_model_command(identifier: str, service: str = "ollama"):
OPENAI_OPTIONS=OPENAI_OPTIONS,
GROQ_OPTIONS=GROQ_OPTIONS,
)



@civitai_cli.command("local-search", help="Search for models stored on disk.")
def local_search_command(query: str):
return local_search_cli(query, MODELS_DIR=MODELS_DIR, FILE_TYPES=FILE_TYPES)
Expand Down
4 changes: 2 additions & 2 deletions civitai_models_manager/modules/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def local_search_cli(query: str, MODELS_DIR: str, FILE_TYPES: List[str]) -> None
for model_name, model_type, model_path, model_size in models:
if query in model_name.lower():
search_results.append((model_name, model_path, model_size))

search_results_table = create_table(
title="",
columns=[("Model Name", "bright_yellow"), ("Path", "white")],
Expand All @@ -98,7 +98,7 @@ def local_search_cli(query: str, MODELS_DIR: str, FILE_TYPES: List[str]) -> None
search_results_table,
{model_name: f"{model_path} [bold][yellow]{model_size}[/yellow][/bold]"},
)

console.print(search_results_table)
# display_models_table(search_results, model_type)

Expand Down
12 changes: 7 additions & 5 deletions civitai_models_manager/modules/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ def inspect_models_cli(MODELS_DIR: str) -> None:
[
f
for f in os.listdir(base_path)
if os.path.isfile(os.path.join(base_path, f)) and
any(f.lower().endswith(ext) for ext in FILE_TYPES)
if os.path.isfile(os.path.join(base_path, f))
and any(f.lower().endswith(ext) for ext in FILE_TYPES)
]
)
path_types_breakdown = f"[white]No subdirectories, {file_count} files[/white]"
path_types_breakdown = (
f"[white]No subdirectories, {file_count} files[/white]"
)
else:
subdir_counts = {}
total_subdir_files = 0
Expand All @@ -106,8 +108,8 @@ def inspect_models_cli(MODELS_DIR: str) -> None:
[
f
for f in os.listdir(subdir_path)
if os.path.isfile(os.path.join(subdir_path, f)) and
any(f.lower().endswith(ext) for ext in FILE_TYPES)
if os.path.isfile(os.path.join(subdir_path, f))
and any(f.lower().endswith(ext) for ext in FILE_TYPES)
]
)
subdir_counts[subdir] = file_count
Expand Down

0 comments on commit a5a6b18

Please sign in to comment.