File size: 655 Bytes
863e23b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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))