Skip to content

Instantly share code, notes, and snippets.

@twobob
Created September 7, 2023 17:22
Show Gist options
  • Save twobob/3835bcc43a0cec4479b8a648deb0582c to your computer and use it in GitHub Desktop.
Save twobob/3835bcc43a0cec4479b8a648deb0582c to your computer and use it in GitHub Desktop.
pip3 install llama-cpp-python
#in my case on windows I had to
New-Item -ItemType SymbolicLink -Path "C:\Python311\bin" -Target "C:\Python311"
#as admin
#I also did not have f2py.exe in my python so I kinda welded it in from a similar one...
#by just dumping the copies in scripts and praying.
#also needed to
Get-ChildItem -Path 'C:\Python311' -Directory | Where-Object { $_.Name -ne 'bin' } | Get-ChildItem -Recurse | Where-Object { $_.PSIsContainer -or $_.Extension -eq '.exe' } | ForEach-Object { icacls $_.FullName /grant "YourUserNameHere:(OI)(CI)F" }
#as admin to give perms to edit the folder.
#before I could
pip3 install llama-cpp-python --force-reinstall --upgrade --no-cache-dir
@twobob
Copy link
Author

twobob commented Sep 7, 2023

lines added to interpreter.py

import sys

Get the command line arguments used to invoke the script

command_line_executed = " ".join(sys.argv)

Get the fully qualified path of the python executable

python_exe_fully_qualified_path = os.path.abspath(sys.executable)

Print the command line executed

print(f"Command line executed: {command_line_executed}")

Print the fully qualified path of the python executable

print(f"Python executable fully qualified path: {python_exe_fully_qualified_path}")

and it continues...

Function schema for gpt-4

which outputs for me:

Python executable fully qualified path: C:\Python311\python.exe

if I run the python.exe for that directly I did not have the support lib installed in there so I have to pip that in properly myself then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment