Skip to content

Commit

Permalink
Fix broken install pyproject.toml
Browse files Browse the repository at this point in the history
- Fix broken install pyproject.toml preventing installation
- change package dependencies from dynamic to static as they were not being instsalled
- Fix broken fstrings
  • Loading branch information
regiellis committed Aug 11, 2024
1 parent b62dc67 commit f17fd45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
17 changes: 13 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent"
]
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
dependencies = [
"typer",
"rich",
"requests",
"shellingham",
"html2text",
"tqdm",
"civitai",
"python-dotenv",
"ollama",
"openai",
"groq"
]

[tool.setuptools]
packages = ["civitai_model_manager"]
Expand Down
6 changes: 3 additions & 3 deletions src/civitai_model_manager/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_model_details(model_id: int) -> Dict[str, Any]:
"trainedWords": response["modelVersions"][0].get("trainedWords", "None"),
"nsfw": Text("Yes", style="yellow") if response.get("nsfw", False) else Text("No", style="bright_red"),
"metadata": {
"stats": f"{response["stats"].get("downloadCount", "")} downloads, {response["stats"].get('thumbsUpCount', '')} likes, {response["stats"].get('thumbsDownCount', '')} dislikes",
"stats": f"{response['stats'].get('downloadCount', '')} downloads, {response['stats'].get('thumbsUpCount', '')} likes, {response['stats'].get('thumbsDownCount', '')} dislikes",
"size": convert_kb(response["modelVersions"][0].get("files")[0].get("sizeKB", "")),
"format": response["modelVersions"][0].get("files")[0].get("metadata", "").get("format", ".safetensors"),
"file": response["modelVersions"][0].get("files")[0].get("name", ""),
Expand Down Expand Up @@ -371,7 +371,7 @@ def get_model_details(model_id: int) -> Dict[str, Any]:
"nsfw": Text("Yes", style="yellow") if response.get("nsfw", False) else Text("No", style="bright_red"),
"download_url": response.get("downloadUrl", ""),
"metadata": {
"stats": f"{response["stats"].get("downloadCount", "")} downloads, {response["stats"].get('thumbsUpCount', '')} likes, {version_data["stats"].get('thumbsDownCount', '')} dislikes",
"stats": f"{response['stat'].get('downloadCount', '')} downloads, {response['stats'].get('thumbsUpCount', '')} likes, {version_data['stats'].get('thumbsDownCount', '')} dislikes",
"size": convert_kb(response["files"][0].get("sizeKB", "")),
"format": response["files"][0].get("metadata").get("format", ".safetensors"),
"file": response["files"][0].get("name", ""),
Expand Down Expand Up @@ -522,7 +522,7 @@ def summarize_model_description(model_id: int, service: str) -> Optional[str]:
model=OLLAMA_OPTIONS["model"],
messages=[
{"role": "assistant", "content": OLLAMA_OPTIONS["system_template"]},
{"role": "user", "content": f"{OLLAMA_OPTIONS["system_template"]} {description}"}
{"role": "user", "content": f"{OLLAMA_OPTIONS['system_template']} {description}"}
# consider adding the system template
# to the prompt since not all models follow the system template
],
Expand Down

0 comments on commit f17fd45

Please sign in to comment.