From dbca9cf627e0dafd7b6d6ba1781e28d8d6fac28c Mon Sep 17 00:00:00 2001 From: Sergii Nechuiviter Date: Tue, 16 Jul 2024 19:19:11 +0100 Subject: [PATCH] Cleanup --- .../README_04_vertex_ai_codegen_streamlit.md | 2 +- .../README_05_putting_all_togather.md | 4 ++-- apps/streamlit_ds_chat/cloud_coiled_io/README.md | 6 +++--- apps/streamlit_ds_chat/ds_chat_streamlit_app.py | 4 +++- apps/streamlit_ds_chat/readme.md | 12 +++++++++++- .../2024-07-02_use_streamlit_as_frontend.md | 2 +- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/apps/streamlit_ds_chat/README_04_vertex_ai_codegen_streamlit.md b/apps/streamlit_ds_chat/README_04_vertex_ai_codegen_streamlit.md index 8e52b9c..16310fb 100644 --- a/apps/streamlit_ds_chat/README_04_vertex_ai_codegen_streamlit.md +++ b/apps/streamlit_ds_chat/README_04_vertex_ai_codegen_streamlit.md @@ -1,6 +1,6 @@ -For testing manager the following questions are used: +For testing manager, the following questions are used: How many unique fruits are there in the dataset? How many fruits likes each person? diff --git a/apps/streamlit_ds_chat/README_05_putting_all_togather.md b/apps/streamlit_ds_chat/README_05_putting_all_togather.md index 9264d71..0f038ae 100644 --- a/apps/streamlit_ds_chat/README_05_putting_all_togather.md +++ b/apps/streamlit_ds_chat/README_05_putting_all_togather.md @@ -1,4 +1,4 @@ -# Step 5. Put all components togather +# Step 5. Put all components together Now I have code for: - running Streamlit.app @@ -19,7 +19,7 @@ conda create -p ./env12 -c conda-forge coiled python=3.12 "numpy<2.0.0" streamli Known issues: -- bokeh don't needed for workers but still is provided +- Bokeh is not needed for workers but it is still provided. - StreamlitAPIException: Streamlit only supports Bokeh version 2.4.3, but you have version 3.5.0 installed. Please run `pip install --force-reinstall --no-deps bokeh==2.4.3` to install the correct version. - start of coiled cluster takes 1-2 minutes, but this will be the same for any cluster start on any tool - hard to acquire good code from code generation; it usually works, but the return value is not exactly what was requested diff --git a/apps/streamlit_ds_chat/cloud_coiled_io/README.md b/apps/streamlit_ds_chat/cloud_coiled_io/README.md index 195494d..913033c 100644 --- a/apps/streamlit_ds_chat/cloud_coiled_io/README.md +++ b/apps/streamlit_ds_chat/cloud_coiled_io/README.md @@ -14,14 +14,14 @@ Your cloud credentials (securely) ``` Works with AWS, GCloud, Azure, etc. -Runs dusk and pure python. +Runs Dask and pure Python. # How to install Coiled Just register on `coiled.io` and follow instructions. Everything is very simple and works great. -The only pitfall: all you installs probably should go from single distribution system. +The only pitfall: all you installs should probably come from single distribution system. If you use conda, you should install everything with `conda install`. If you use `pip`, you should install all packages with `pip install`. @@ -34,7 +34,7 @@ coiled login > Authentication successful 🎉 > Credentials have been saved at /home/s-nechuiviter/.config/dask/coiled.yaml -Use `coiled setup gcp` once to setup connection to GCP. +Use `coiled setup gcp` once to set up connection to GCP. Coiled requires that all modules should be `conda` compatible, at least if start from conda environment. Or use pip/venv everywhere. diff --git a/apps/streamlit_ds_chat/ds_chat_streamlit_app.py b/apps/streamlit_ds_chat/ds_chat_streamlit_app.py index 8b283b7..adc9e6a 100644 --- a/apps/streamlit_ds_chat/ds_chat_streamlit_app.py +++ b/apps/streamlit_ds_chat/ds_chat_streamlit_app.py @@ -1,4 +1,3 @@ -import coiled import streamlit as st import importlib @@ -34,6 +33,8 @@ # Create or connect to a Coiled cluster with st.spinner("Creating or connecting to a Coiled cluster"): if "cluster" not in st.session_state: + import coiled + cluster = coiled.Cluster( name="my-cluster", n_workers=1, idle_timeout="20 minutes" ) @@ -67,6 +68,7 @@ if not uploaded_file: st.error("Upload dataset to work with") + st.stop() else: # if uploaded_file: # and question: # and anthropic_api_key: dataframe = pd.read_csv(uploaded_file) diff --git a/apps/streamlit_ds_chat/readme.md b/apps/streamlit_ds_chat/readme.md index ae4ee79..e9c7ae4 100644 --- a/apps/streamlit_ds_chat/readme.md +++ b/apps/streamlit_ds_chat/readme.md @@ -1,6 +1,16 @@ +Title +feat: add Streamlit app for DS chat with Google Vertex AI and Coiled integration + +Overview +Introduced a new Streamlit application for data science chat functionality using Google Vertex AI. +Added multiple supporting scripts and modules for handling various functionalities such as code generation, cloud execution, and data visualization. +Integrated Coiled for distributed computing and remote code execution. +Provided detailed documentation and examples for setting up the environment, using the application, and testing different components. + + # Setting up a local development environment -Before we can actually start building Streamlit apps, we will first have to setup a development environment. +Before we can actually start building Streamlit apps, we will first have to set up a development environment. Let's start by installing and setting up a conda environment. diff --git a/projects/ds_chat/20_in_progress/2024-07-02_use_streamlit_as_frontend.md b/projects/ds_chat/20_in_progress/2024-07-02_use_streamlit_as_frontend.md index 84cdb4e..7f29ecd 100644 --- a/projects/ds_chat/20_in_progress/2024-07-02_use_streamlit_as_frontend.md +++ b/projects/ds_chat/20_in_progress/2024-07-02_use_streamlit_as_frontend.md @@ -1,7 +1,7 @@ Use https://streamlit.io/ as chat frontend. Requirements: -- simple Stream.lit app - empty app - done +- simple Streamlit app - empty app - done - connect to backend - get user questions - print answers