diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c34d12e..302b2f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,4 +13,4 @@ repos: rev: 24.2.0 hooks: - id: black -exclude: 'generated/.*|artifacts/.*|.jsonl' +exclude: 'generated/.*|artifacts/.*|.jsonl|.csv' diff --git a/apps/6_call_azure_ai_search/1_create_index.py b/apps/6_call_azure_ai_search/1_create_index.py index 39721f6..98c2470 100644 --- a/apps/6_call_azure_ai_search/1_create_index.py +++ b/apps/6_call_azure_ai_search/1_create_index.py @@ -9,7 +9,7 @@ def load_texts() -> list: # for simplicity, hardcoding the path to the text file - with open("./apps/6_call_azure_ai_search/data/contoso_rules.txt") as f: + with open("./datasets/contoso_rules.csv") as f: return f.readlines() diff --git a/apps/99_streamlit_examples/README.md b/apps/99_streamlit_examples/README.md index f2dff68..6825df2 100644 --- a/apps/99_streamlit_examples/README.md +++ b/apps/99_streamlit_examples/README.md @@ -61,6 +61,10 @@ Access to http://localhost:8501 and select the sample you want to run from the s ![Create image](../../docs/images/99_streamlit_examples.createimage.png) +#### 8. Visualize location + +![Visualize location](../../docs/images/99_streamlit_examples.map.png) + ## References - [🎈 Streamlit + LLM Examples App](https://github.com/streamlit/llm-examples) diff --git a/apps/99_streamlit_examples/pages/8_Visualize_location.py b/apps/99_streamlit_examples/pages/8_Visualize_location.py new file mode 100644 index 0000000..26c2de9 --- /dev/null +++ b/apps/99_streamlit_examples/pages/8_Visualize_location.py @@ -0,0 +1,22 @@ +import pandas as pd +import streamlit as st +from dotenv import load_dotenv + +load_dotenv() + + +with st.sidebar: + "[Azure Portal](https://portal.azure.com/)" + "[Azure OpenAI Studio](https://oai.azure.com/resource/overview)" + "[View the source code](https://github.com/ks6088ts-labs/workshop-azure-openai/blob/main/apps/99_streamlit_examples/pages/8_Visualize_location.py)" + +st.title("Visualize location") +st.info("This is a sample to visualize location.") + +uploaded_file = st.file_uploader("Upload an article", type=("csv")) +if uploaded_file: + df = pd.read_csv(uploaded_file) + st.map( + data=df, + size=1, + ) diff --git a/apps/6_call_azure_ai_search/data/contoso_rules.txt b/datasets/contoso_rules.csv similarity index 96% rename from apps/6_call_azure_ai_search/data/contoso_rules.txt rename to datasets/contoso_rules.csv index b0971f3..94d1215 100644 --- a/apps/6_call_azure_ai_search/data/contoso_rules.txt +++ b/datasets/contoso_rules.csv @@ -27,4 +27,4 @@ Working during a full moon is prohibited. Every employee must bring a homemade snack once a month. The company logo must always include a smiley face. Office plants must be watered by the person with the longest name. -Every Friday, employees must write a haiku about their day. +Every Friday, employees must write a haiku about their day. \ No newline at end of file diff --git a/datasets/locations.csv b/datasets/locations.csv new file mode 100644 index 0000000..cf321b0 --- /dev/null +++ b/datasets/locations.csv @@ -0,0 +1,32 @@ +time,latitude,longitude +12:00, 35.0116, 135.7681 +12:01, 35.0120, 135.7685 +12:02, 35.0124, 135.7689 +12:03, 35.0128, 135.7693 +12:04, 35.0132, 135.7697 +12:05, 35.0136, 135.7701 +12:06, 35.0140, 135.7705 +12:07, 35.0144, 135.7709 +12:08, 35.0148, 135.7713 +12:09, 35.0152, 135.7717 +12:10, 35.0156, 135.7721 +12:11, 35.0160, 135.7725 +12:12, 35.0164, 135.7729 +12:13, 35.0168, 135.7733 +12:14, 35.0172, 135.7737 +12:15, 35.0176, 135.7741 +12:16, 35.0180, 135.7745 +12:17, 35.0184, 135.7749 +12:18, 35.0188, 135.7753 +12:19, 35.0192, 135.7757 +12:20, 35.0196, 135.7761 +12:21, 35.0200, 135.7765 +12:22, 35.0204, 135.7769 +12:23, 35.0208, 135.7773 +12:24, 35.0212, 135.7777 +12:25, 35.0216, 135.7781 +12:26, 35.0220, 135.7785 +12:27, 35.0224, 135.7789 +12:28, 35.0228, 135.7793 +12:29, 35.0232, 135.7797 +12:30, 35.0236, 135.7801 \ No newline at end of file diff --git a/docs/images/99_streamlit_examples.map.png b/docs/images/99_streamlit_examples.map.png new file mode 100644 index 0000000..948102a Binary files /dev/null and b/docs/images/99_streamlit_examples.map.png differ