Conversation
Traceback (most recent call last):
File "/Users/jbenedik/Projects/secure-ai/.venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.__dict__)
File "/Users/jbenedik/Projects/secure-ai/secure_ai/Docs.py", line 379, in <module>
app()
File "/Users/jbenedik/Projects/secure-ai/secure_ai/Docs.py", line 258, in app
retriever = configure_retriever(linked_files, db_path, embeddings_path, embeddings_model_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jbenedik/Projects/secure-ai/secure_ai/Docs.py", line 140, in configure_retriever
print("\n ######### old_files ######### \n", old_files, )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'old_files' where it is not associated with a value
need to audit the os.fork() / os.kill() / os.wait() logic. for some reason multiprocessing wasn't working with pyoxidizer properly
|
Also noticed this additional exception when refreshing while i guess document indexing, and choosing the database that was being updated (in the background?)... |
|
For running asyncio in the background, could perhaps use this approach: |
|
I get this error sometimes, so perhaps pyoxidizer is doing something before the fork. Need to troubleshoot that still, using a background thread would be a better solution. |
|
Tested on Linux and it works as before. |
|
@mrjbq7 this looks great! I built and tested on my Mac. works great. minor issue of the double-launch that we discussed. when I copied the app over to my other computer, Mac OS said it was damaged and would not run it. I tried this process in reverse too with the same result. so it seems the app will only launch directly on the machine it was built on. |
|
okay, i think the double app issue was fixed -- worth doing some testing then can keep adding features , or merge and do more different stuff |
| # check whether the saved trial time plus trial period is greater than the current time. If so this | ||
| # indicates the trial period is over | ||
| return True if current_timestamp < trial_timestamp else False | ||
| return current_timestamp < trial_timestamp |
There was a problem hiding this comment.
Haha both of these are great changes and obvious from looking from the outside.
|
As an aside, I'm hoping to update pyoxidizer to allow builds with python 3.11 and 3.12. I made a PR for them: Locally I've been testing with python 3.11. |
This reverts commit 88803fa.

Some minor fixes and some macOS prototype code.
Don't merge yet, but might be a worthwhile initial direction.
ruffwarnings and minor python style things~/.secure_aiand~/SecureAIby default so no need to set that if using default locationold_fileswhen refreshing a page while a document is being indexedrumpsmodule, has the version, an "Open" for opening a web browser to the streamlit backend, and a "Quit" to close it.For some reason, the multiprocessing module wasn't working with pyoxidizer, so I just did a quick-and-dirty os.fork/os.kill/os.wait. This is largely because
streamlit.web.bootstrap.runusesasyncio.runand needs to set signals in the main thread, but we want the main thread to run the UI thread... so either need to re-implementbootstrap.runin a background thread, or get the process fork/join logic to be clean and correct.For details about rumps: https://github.com/jaredks/rumps. It also has notification integration which might be really useful for things like "document(s) finished indexing"...