Spaces:
Build error
Build error
Commit ·
f790556
1
Parent(s): a17d0ff
Update app.py
Browse files176 unmodified lines177178179180181182183184185186187188189190191192193176 unmodified linesst.table(schema_df[["name", "dataType"]]) # Display only the name and dataType columns# Before ingesting data into Weaviate, check if CSV columns match the class schemaif csv_file is not None and class_schema: # Ensure class_schema is not Nonedata = csv_file.read().decode("utf-8")dataframe = pd.read_csv(StringIO(data))# Check if columns matchschema_columns = [prop["name"] for prop in class_schema["properties"]]if set(dataframe.columns) != set(schema_columns):st.error("The columns in the uploaded CSV do not match the schema of the selected class. Please check and upload the correct CSV.")else:# Ingest data into Weaviateingest_data_to_weaviate(dataframe, class_name, class_description)# Input for questionsquestions = st.text_area("Enter your questions (one per line)")176 unmodified lines177178179180181182183184185186187188189190191192193194195196197198176 unmodified linesst.table(schema_df[["name", "dataType"]]) # Display only the name and dataType columns# Before ingesting data into Weaviate, check if CSV columns match the class schemaif csv_file is not None:data = csv_file.read().decode("utf-8")dataframe = pd.read_csv(StringIO(data))# Display the uploaded CSV datast.write("Uploaded CSV Data:")st.write(dataframe)# Check if columns matchif class_schema: # Ensure class_schema is not Noneschema_columns = [prop["name"] for prop in class_schema["properties"]]if set(dataframe.columns) != set(schema_columns):st.error("The columns in the uploaded CSV do not match the schema of the selected class. Please check and upload the correct CSV or create a new class.")else:# Ingest data into Weaviateingest_data_to_weaviate(dataframe, class_name, class_description)# Input for questionsquestions = st.text_area("Enter your questions (one per line)")
app.py+12-7