| import streamlit as st
|
| import pandas as pd
|
| from custom_ollama import query_ollama
|
|
|
|
|
| st.title("AI-Powered Data Analysis with Local Ollama (FastAPI)")
|
|
|
|
|
| uploaded_file = st.file_uploader("Upload your dataset (CSV)", type=["csv"])
|
| if uploaded_file:
|
| df = pd.read_csv(uploaded_file)
|
| st.write("### Preview of Your Dataset", df.head())
|
|
|
|
|
| if st.button("Run Data Analysis"):
|
| with st.spinner("Analyzing your data..."):
|
| prompt = f"Perform a basic exploratory data analysis on the following dataset:\n{df.head()}"
|
| response = query_ollama(prompt)
|
| st.success("Analysis complete!")
|
| st.write(response)
|
|
|