Spaces:
Build error
Build error
Commit ·
77a6da5
1
Parent(s): 89dd001
Update weaviate_utils.py
Browse files82 unmodified lines838485868788899091929340 unmodified lines13413513613213713813914014114214314482 unmodified lines data = csv_file.read().decode("utf-8") dataframe = pd.read_csv(StringIO(data))
# After converting the CSV to a dataframe embedded_table = tapas_utils.embed_table(dataframe) # Store the embedded table in Weaviate client.data_object.create({"embeddedTable": embedded_table.tolist()}, selected_class) # Fetch the schema for the selected class class_schema = get_class_schema(client, selected_class)
40 unmodified lines return cls return None except weaviate.exceptions.SchemaValidationException: return None return None
def retrieve_relevant_table(client, selected_class, question_embedding): # Query Weaviate to get the most relevant table results = client.query.get(selected_class, ["embeddedTable"]).with_near_text(question_embedding).do() # Extract the table from the results table = results.get('data', {}).get('Get', {}).get('Things', [])[0].get('embeddedTable') return tableweaviate_utils.py+13-1