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

Linux path with spaces #1138

Closed
jojorne opened this issue Sep 24, 2024 · 3 comments
Closed

Linux path with spaces #1138

jojorne opened this issue Sep 24, 2024 · 3 comments

Comments

@jojorne
Copy link

jojorne commented Sep 24, 2024

The Issue

Automatic UDisks2 drivers are mounted using their label. At the moment, to change the label, I need to run in emergency mode.

run_a-gguf-model.sh

python koboldcpp.py --model '/run/media/My AI Models/models/a-gguf-model.gguf'

I tried with quotation marks and even with backslashes. It always load as /run/media/My or /run/media/My\. The error happens inside python argparse.

Edit: This actually works, turns out the problem was with the launcher script all along.

I discovered that a python script works.

run_a-gguf-model.py

#!/bin/python
import os
os.system(python koboldcpp.py --model "/run/media/My AI Models/models/a-gguf-model.gguf")
@LostRuins
Copy link
Owner

Cool alright, but what do I need to change? Sounds like a launcher script issue.
Paths with spaces have been tested to work, both relative and absolute paths should work as well.

@jojorne jojorne closed this as completed Sep 25, 2024
@jojorne
Copy link
Author

jojorne commented Oct 4, 2024

I found a better way. 😝

#!/bin/env -S konsole -e python3
import os
try:
    print('==========')
    with open('readme/Prompt Template/Prompt Template - Gemma 2.txt', 'r') as f: print(f.read())
    print('==========')
    os.system(f'koboldcpp/koboldcpp.py --config "{os.path.splitext(os.path.basename(__file__))[0]}.kcpps"')
finally:
    print()
    os.system(f'read -p \'Press any key to continue . . . \'')

@LostRuins
Copy link
Owner

Great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants