Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: f-string: unmatched '[' #2

Closed
ali0une opened this issue Aug 11, 2024 · 4 comments
Closed

SyntaxError: f-string: unmatched '[' #2

ali0une opened this issue Aug 11, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ali0une
Copy link

ali0une commented Aug 11, 2024

Hi.

Not sure if i'm doing things right, but the command below give me an error.

Just started LM Studio server on port 5000

(venv) ali0une@Debian:~/whatever/civitai-cli-manager$ civitai-cli-manager --explain 619343 --service openai
Traceback (most recent call last):
  File "/whatever/civitai-cli-manager/venv/bin/civitai-cli-manager", line 5, in <module>
    from civitai_model_manager.cli import main
  File "/whatever/civitai-cli-manager/venv/lib/python3.11/site-packages/civitai_model_manager/cli.py", line 335
    "stats": f"{response["stats"].get("downloadCount", "")} downloads, {response["stats"].get('thumbsUpCount', '')} likes, {response["stats"].get('thumbsDownCount', '')} dislikes",
                          ^^^^^
SyntaxError: f-string: unmatched '['

This is my .env

#https://developer.civitai.com/docs/getting-started/setup-profile#create-an-api-key
CIVITAI_TOKEN=xxxxxxxxx
#/location/of/your/models/
MODELS_DIR=/whatever/models/

# http://localhost:11434 or http://host.docker.internal:11434
OLLAMA_API_BASE=http://localhost:5000
#OLLAMA_MODEL=tinydolphin # Tuned to tinydolphin..as best I could
HTML_OUT=False # Some models require HTML conversion, some don't
TEMP=0
TOP_P=0

#OPENAI_MODEL=gpt-4o-mini
#OPENAI_API_KEY= # sk-proj

#GROQ_MODEL=llama-3.1-70b-versatile
#GROQ_API_KEY=#//
@regiellis regiellis self-assigned this Aug 11, 2024
@regiellis regiellis added the bug Something isn't working label Aug 11, 2024
@regiellis
Copy link
Owner

@ali0une4, no this was a oversight on my part in and had to be corrected in the code. The 0.5.1 release should fix the issue; Make to pip/pipx uninstall first then re-install before trying again. Also, if OLLAMA_API_BASE=http://localhost:5000, try OLLAMA_API_BASE=http://localhost:5000/v1/

@regiellis regiellis reopened this Aug 11, 2024
@ali0une
Copy link
Author

ali0une commented Aug 11, 2024

Thanks!

OK working with no error now ... but can't find the correct endpoint for LM Studio, i'm going to update my other issue about it.

Don't know how to pip uninstall when i pip install . , did pip uninstall -r requirements.txt but it did not suffice as i had same error ... had to delete venv and reinstall (sorry i'm python noob :-/ )
Please let me know!

@regiellis
Copy link
Owner

Thanks!

OK working with no error now ... but can't find the correct endpoint for LM Studio, i'm going to update my other issue about it.

Don't know how to pip uninstall when i pip install . , did pip uninstall -r requirements.txt but it did not suffice as i had same error ... had to delete venv and reinstall (sorry i'm python noob :-/ ) Please let me know!

When you use pip install . the package is installed as [package]-[version] so in this case civitai_model_manager 0.5.0. you can do a pip list to find the name. PIP will install it by its package name wheres PIPX will install it by the name I am exposing....in this case "civitai-cli-manager". I recommend you install it via pipx install . PIPX will create a virtualenv for you and manage the package.

@ali0une
Copy link
Author

ali0une commented Aug 11, 2024

Many thanks for this clear explaination!

@ali0une ali0une closed this as completed Aug 11, 2024
regiellis added a commit that referenced this issue Aug 11, 2024
Add more file types for download
Fix #1: Add components folder and move helpers.py to components folder
Fix #2: Add utils.py to components folder
@regiellis regiellis reopened this Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants