-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Adds support for "local" LLMs via ollama [WIP] #762
Conversation
|
||
# Open web browser to local server | ||
webbrowser.open(f'http://localhost:{port}/') | ||
except: |
Check notice
Code scanning / CodeQL
Empty except Note
|
||
# Open web browser to local server | ||
webbrowser.open(f'http://localhost:{port}/') | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
…no heartbeat); opens AI optimization dropdown if there is an issue that needs to be resolved.
…s/scalene into other_vendor_support
shutil.copy(file_path, os.path.join(temp_dir, 'index.html')) | ||
|
||
# Open web browser in a new subprocess | ||
url = f'http://localhost:{port}/' |
Check notice
Code scanning / CodeQL
Unused local variable Note
self.end_headers() | ||
return | ||
else: | ||
return http.server.SimpleHTTPRequestHandler.do_GET(self) |
Check warning
Code scanning / CodeQL
Use of the return value of a procedure Warning
SimpleHTTPRequestHandler.do_GET
server_running = True | ||
|
||
class CustomHandler(http.server.SimpleHTTPRequestHandler): | ||
def do_GET(self): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
import shutil | ||
import socket | ||
import socketserver | ||
import subprocess |
Check notice
Code scanning / CodeQL
Unused import Note
# url = f"file:///{output_fname}" | ||
# webbrowser.open(url) | ||
# show_browser(output_fname, SCALENE_PORT, Scalene.__orig_python) | ||
if True: |
Check warning
Code scanning / CodeQL
Constant in conditional expression or statement Warning
# Create a temporary directory | ||
with tempfile.TemporaryDirectory() as temp_dir: | ||
# Create a command with the required flags | ||
chrome_cmd = f'{chrome_path} %s --disable-web-security --user-data-dir="{temp_dir}"' |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
localhost
when ollama is running locally. This won't work in settings where it's not possible to open a server, like ColabTO DO: