Fix pandas indexing method for knowledge base imports (#12637) (#12638)

Co-authored-by: CN-P5 <heibai2006@qq.com>
This commit is contained in:
CN-P5 2025-01-13 09:06:59 +08:00 committed by GitHub
commit cd257b91c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View file

@ -286,7 +286,7 @@ class AppAnnotationService:
df = pd.read_csv(file)
result = []
for index, row in df.iterrows():
content = {"question": row[0], "answer": row[1]}
content = {"question": row.iloc[0], "answer": row.iloc[1]}
result.append(content)
if len(result) == 0:
raise ValueError("The CSV file is empty.")