Spaces:
Sleeping
Sleeping
Commit History
-
Create .streamlit/secrets.toml
Verified signature49d7b08 -
Update app.py
Verified signatureced0116
-
Complete Refactored Code
Verified signatureImprovement: Constants: Define constants at the top for model names and safety settings to improve readability and maintainability. Function for Image Saving: While a small task, encapsulating temporary file saving could be a good practice for larger applications. For this case, it's fine as is. Redundant pathlib for temp_image_path: You create a Path object but then pass it to read_bytes() which expects a string or Path-like object. It's okay, but str(temp_image_path) could be used for clarity if needed by other functions, although read_bytes() handles Path directly. Improvement: Streamlit reruns the script from top to bottom whenever there's an interaction. Re-initializing the GenerativeModel every time is inefficient. Change: Use @st.cache_resource to cache the model. Improvement: The chat_session should ideally be managed within st.session_state to maintain a persistent conversation with the model across Streamlit reruns for a single user, if you intend to have a continued conv…a51a732
-
Update README.md
Verified signature7ad14d4 -
Update app.py
Verified signature896fb20 -
Create requirements.txt
Verified signature861b9ac -
Create app.py
Verified signature0dbe55a -
initial commit
Verified signature2d7253f