-
Notifications
You must be signed in to change notification settings - Fork 144
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
New Feature Request: Support for Ubuntu OS #13
Comments
Hey, if you want a very quick solution, I used Mistral-7B-v0.1 to convert usage of New
New import tkinter as tk
import tkinter.messagebox
import requests
import threading
import subprocess
import os
import sys
import config
def setup():
if not os.path.exists(config.model_folder):
if input(f"Model folder {config.model_folder} does not exist. Create it? (y/n) ").lower() == 'y':
os.mkdir(config.model_folder)
current = os.listdir(config.model_folder)
for model in config.models:
if model == 'default':
continue
if config.models[model]['type'] == 'local':
if config.models[model]['filename'] not in current:
if input(f'Model {model} not found in {config.model_folder}. Would you like to download it? (y/n) ').lower() == 'y':
url = config.models[model]['url']
print(f"Downloading {model} from {url}...")
subprocess.run(['curl', '-L', url, '-o', os.path.join(
config.model_folder, config.models[model]['filename'])])
else:
print(f"Model {model} found in {config.model_folder}.")
class ModelPickerApp:
def __init__(self):
self.root = tk.Tk()
self.root.title("ModelPickerApp")
self.root.iconphoto(False, tk.PhotoImage(file="icon.png"))
self.model_var = tk.StringVar()
# Dynamically create menu items from the MENUBAR_OPTIONS
self.menu_items = {}
for (i, option) in enumerate(config.models):
if option == 'default':
continue
self.menu_items[option] = tk.Radiobutton(
self.root, text=option, value=option, variable=self.model_var,
command=self.pick_model)
self.menu_items[option].grid(row=i, column=0, sticky="W")
self.menu_items[config.models['default']].select()
def pick_model(self):
# Send the choice to the local proxy app
choice = self.model_var.get()
try:
response = requests.post(
"http://localhost:5001/set_target", json={"target": choice})
if response.status_code == 200:
print(f"Successfully sent selection: {choice}.")
else:
tk.messagebox.showerror(
"Error", f"Failed to send selection. Server responded with: {response.status_code}.")
except requests.RequestException as e:
tk.messagebox.showerror(
"Error", f"Failed to send selection. Error: {e}.")
def run_server(self):
subprocess.run(['python', 'proxy.py'])
if __name__ == '__main__':
if '--setup' in sys.argv:
setup()
app = ModelPickerApp()
print("Running server...")
server_thread = threading.Thread(target=app.run_server)
server_thread.start()
app.root.mainloop() |
Jan, how about you make a formal merge request which detects the os and use rumps when on mac, or tkinter on Linux? That would make sure the thing keeps working |
TBH I thought @danielgross should weigh in before I do the work. :) |
Hello Maintainers,
I recently came across your incredible package, "Use GitHub Copilot locally on your Macbook with one-click!".
I would love to be able to use this package in Ubuntu as well.
The current version of the package supports MacOS only. This feature request is to extend the support to Ubuntu. This would enable a wider range of developers to benefit from this package.
The text was updated successfully, but these errors were encountered: