[ERROR] Failed with error: Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pandasai/pipelines/chat/code_execution.py", line 87, in execute
result = self.execute_code(input, code_context)
File "/usr/local/lib/python3.10/site-packages/pandasai/pipelines/chat/code_execution.py", line 172, in execute_code
exec(code, environment)
File "", line 1, in
NameError: name 'Python' is not defined
< /code>
Я не уверен, что здесь может произойти.
Итак, вот мои скрипты.version: '3.8'
services:
app:
build: .
container_name: streamlit_app
ports:
- "8501:8501"
volumes:
- .:/app
depends_on:
- ollama
ollama:
image: ollama/ollama
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
entrypoint: ["/bin/sh", "-c", "ollama serve"]
volumes:
ollama_data:
from pandasai.llm.local_llm import LocalLLM ## Importing LocalLLM for local Meta Llama 3 model
import streamlit as st
import pandas as pd # Pandas for data manipulation
from pandasai import SmartDataframe # SmartDataframe for interacting with data using LLM
# Function to chat with CSV data
def chat_with_csv(df,query):
llm = LocalLLM(
api_base="http://ollama:11434/v1",
model="llama3")
pandas_ai = SmartDataframe(df, config={"llm": llm})
result = pandas_ai.chat(query)
return result
st.set_page_config(layout='wide')
st.title("Multiple-CSV ChatApp powered by LLM")
# Upload multiple CSV files
input_csvs = st.sidebar.file_uploader("Upload your CSV files", type=['csv'], accept_multiple_files=True)
# Check if CSV files are uploaded
if input_csvs:
# Select a CSV file from the uploaded files using a dropdown menu
selected_file = st.selectbox("Select a CSV file", [file.name for file in input_csvs])
selected_index = [file.name for file in input_csvs].index(selected_file)
#load and display the selected csv file
st.info("CSV uploaded successfully")
data = pd.read_csv(input_csvs[selected_index])
st.dataframe(data.head(3),use_container_width=True)
#Enter the query for analysis
st.info("Chat Below")
input_text = st.text_area("Enter the query")
#Perform analysis
if input_text:
if st.button("Chat with csv"):
st.info("Your Query: "+ input_text)
result = chat_with_csv(data,input_text)
st.success(result)
Я запускаю простой retremlit + ollama + python, чтобы запустить AI Chatbot.[code][ERROR] Failed with error: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pandasai/pipelines/chat/code_execution.py", line 87, in execute result = self.execute_code(input, code_context) File "/usr/local/lib/python3.10/site-packages/pandasai/pipelines/chat/code_execution.py", line 172, in execute_code exec(code, environment) File "", line 1, in NameError: name 'Python' is not defined < /code> Я не уверен, что здесь может произойти. Итак, вот мои скрипты.version: '3.8'
RUN pip install --no-cache-dir -r requirements.txt
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] [/code] [b] App.py[/b] [code] from pandasai.llm.local_llm import LocalLLM ## Importing LocalLLM for local Meta Llama 3 model import streamlit as st import pandas as pd # Pandas for data manipulation from pandasai import SmartDataframe # SmartDataframe for interacting with data using LLM
# Function to chat with CSV data def chat_with_csv(df,query): llm = LocalLLM( api_base="http://ollama:11434/v1", model="llama3") pandas_ai = SmartDataframe(df, config={"llm": llm}) result = pandas_ai.chat(query) return result
st.set_page_config(layout='wide') st.title("Multiple-CSV ChatApp powered by LLM")
# Check if CSV files are uploaded if input_csvs: # Select a CSV file from the uploaded files using a dropdown menu selected_file = st.selectbox("Select a CSV file", [file.name for file in input_csvs]) selected_index = [file.name for file in input_csvs].index(selected_file)
#load and display the selected csv file st.info("CSV uploaded successfully") data = pd.read_csv(input_csvs[selected_index]) st.dataframe(data.head(3),use_container_width=True)
#Enter the query for analysis st.info("Chat Below") input_text = st.text_area("Enter the query")
#Perform analysis if input_text: if st.button("Chat with csv"): st.info("Your Query: "+ input_text) result = chat_with_csv(data,input_text) st.success(result) [/code] Кто -нибудь может помочь?
Я пытаюсь запустить совместную работу Однако каждый раз, когда я пытаюсь запустить _, demo_mc_gen_raw = lm(demo_mc_gen_prompt, stop_seq= , logit_bias={}), который находится в разделе Доступ к неопределенности LLM совместной работы, я всегда получить...
Когда я запускаю этот код
from math import *
import matplotlib.pyplot as plt
N = 10
p0 = 0.8
p_dist =
# print(p_dist)
s = [sum(p_dist ) for i in range(len(p_dist))]
print(sum(p_dist))
print( i, p_dist, s )
for k in range(N + 1):
print(k, p_dist...
Я новичок в Python, и мне нужна ваша помощь. У меня Mac, и я использую Python 3. Работаю с SublimeText, и вот что я получаю при запуске моего кода ==> я получил эту ошибку:NameError: name '__tablename__' is not defined