mohamed1ai's picture
Create app.py
863e23b verified
raw
history blame
655 Bytes
from pandasai.llm.local_llm import LocalLLM
from pandasai import Agent
import streamlit as st
import pandas as pd
model = LocalLLM(
api_base='http://0.0.0.0:11434/v1',
model='llama3'
)
st.title('MBA data analysis with LLAMA3')
upload_file = st.sidebar.file_uploader(
'upload a csv file',
type=["csv"]
)
if upload_file is not None:
data =pd.read_csv(upload_file)
st.write(data.head(7))
agent = Agent(data, config={"llm": model})
prompt = st.text_input('Prompt:')
if st.button("Generation"):
if prompt:
with st.spinner("Generating rep ...."):
st.write(agent.chat(prompt))