Skip to content

Commit

Permalink
The Local Update
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas authored Oct 11, 2023
2 parents fade9ff + 4945e65 commit c9aeda5
Show file tree
Hide file tree
Showing 7 changed files with 689 additions and 481 deletions.
30 changes: 30 additions & 0 deletions interpreter/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import os
import platform
import pkg_resources
import ooba
import appdirs
from ..utils.get_config import get_config_path
from ..terminal_interface.conversation_navigator import conversation_navigator

Expand Down Expand Up @@ -144,6 +146,12 @@ def cli(interpreter):
action="store_true",
help="get Open Interpreter's version number",
)
parser.add_argument(
'--change_local_device',
dest='change_local_device',
action='store_true',
help="change the device used for local execution (if GPU fails, will use CPU)"
)

# TODO: Implement model explorer
# parser.add_argument('--models', dest='models', action='store_true', help='list avaliable models')
Expand Down Expand Up @@ -212,6 +220,28 @@ def cli(interpreter):
version = pkg_resources.get_distribution("open-interpreter").version
print(f"Open Interpreter {version}")
return

if args.change_local_device:
print("This will uninstall the local LLM interface (Ooba) in order to reinstall it for a new local device. Proceed? (y/n)")
if input().lower() == "n":
return

print("Please choose your GPU:\n")

print("A) NVIDIA")
print("B) AMD (Linux/MacOS only. Requires ROCm SDK 5.4.2/5.4.3 on Linux)")
print("C) Apple M Series")
print("D) Intel Arc (IPEX)")
print("N) None (I want to run models in CPU mode)\n")

gpu_choice = input("> ").upper()

while gpu_choice not in 'ABCDN':
print("Invalid choice. Please try again.")
gpu_choice = input("> ").upper()

ooba.install(force_reinstall=True, gpu_choice=gpu_choice, verbose=args.debug_mode)
return

# Depracated --fast
if args.fast:
Expand Down
Loading

0 comments on commit c9aeda5

Please sign in to comment.