I am fairly new to streamlt functionality, and I have been following the using streamlit to create an executable and running it locally threads. Currently, my team and I are working on an application powered by a Large Language Model (LLM) using Streamlit. Our goal is to create an executable where the code is protected and unreadable to others. To achieve this, I’ve outlined a three-step process:
- Code Obfuscation: Utilizing PyArmor to obfuscate the code.
- Executable Creation: Using PyInstaller to turn the obfuscated code into an executable.
- Docker Image Creation: Packaging the entire executable within a Docker image.
I’ve successfully created the executable by modifying the .spec file, which resulted in a ‘streamlit_main’ executable file. However, I’ve encountered a significant challenge at this stage. When I attempt to run the executable using ./streamlit_main
, I receive an error:
WARNING streamlit:
Warning: to view this Streamlit app on a browser, run it with the following
command:
streamlit run ./streamlit_main_query [ARGUMENTS]
2024-01-22 22:24:05.392 WARNING streamlit.runtime.state.session_state_proxy: Session state does not function when running a script without streamlit run
.
Yet, executing this command leads to another error stating that streamlit run
can only operate with Python files, the error I see is:
Error: Streamlit requires raw Python (.py) files, but the provided file has no extension.
I’m stuck because I can’t add any source code or Python files to this setup. Does anyone know a better way to do this? Any advice or tips would be really helpful.