Spaces:
Build error
Build error
Commit History
-
Update weaviate_utils.py
b1a798e -
Update weaviate_utils.py
fbc75ef -
Update weaviate_utils.py
3ae17c8 -
Update ui_utils.py
f419ec9 -
Update app.py
d6f51dc -
Update app.py
aa88d2a -
Update app.py
58edde1 -
Create __init__.py
990ad28 -
Update weaviate_utils.py
41b5bdf -
Update weaviate_utils.py
dbfca31 -
Update weaviate_utils.py
d0443ee -
Update ui_utils.py
b9dd2dd -
Update tapas_utils.py
92a392e -
Update app.py
d304ae4 -
Update app.py
862e59b -
Update ui_utils.py
7ba8571 -
Create ui_utils.py
d934c26 -
Update tapas_utils.py
0e0ce94 -
Update app.py
ed7f9aa -
Update weaviate_utils.py
340cc83 -
Update app.py
2734d11 -
Create tapas_utils.py
53d88c3 -
Create weaviate_utils.py
736842d -
Update app.py
33d813d -
Update requirements.txt
f1ea802 -
Update app.py
41bf6ed -
added debugging features
3b3c852 -
Update app.py
f790556 -
Update app.py
a17d0ff -
Update app.py
6b58ffb -
Update app.py
d0de0d8 -
Update app.py
04376ef -
Added map_dtype_to_weaviate function
a4a1c61 -
modified ingest_data_to_weaviate function
modified def ingest_data_to_weaviate(dataframe, class_name, class_description): # Create class schema class_schema = { "class": class_name, "description": class_description, "properties": [] # Start with an empty properties list } # Try to create the class without properties first try: client.schema.create({"classes": [class_schema]}) except weaviate.exceptions.SchemaValidationException: # Class might already exist, so we can continue pass # Now, let's add properties to the class for column_name, data_type in zip(dataframe.columns, dataframe.dtypes): property_schema = { "name": column_name, "description": f"Property for {column_name}", "dataType": [map_dtype_to_weaviate(data_type)] } try: client.schema.property.create(class_name, property_schema) except weaviate.exceptions.SchemaValidationException: # Propert…203bb0f -
Update app.py
4758881 -
Update app.py
dfcdc4f -
Weaviate schema based on user input and csv upload
UI Input for Class and Description: We'll add an input field in the Streamlit app where users can define the class name and description of the CSV they're uploading. Auto-Populate Schema from CSV: Once the CSV is uploaded, we'll read its headers to determine the column names. We can then use simple heuristics to determine the data type of each column (e.g., if a column contains only numbers, it's likely a float or int, if it matches date patterns, it's a date, otherwise, it's a string). We'll also use the column names as descriptions for simplicity, but this can be enhanced further if needed. Create Schema in Weaviate: Using the class name, description, and the auto-populated properties, we'll define the schema and create it in Weaviate. Ingest Data: Once the schema is created, we can then ingest the data from the CSV into Weaviate.b9d05c0 -
Update app.py
46ad3c2 -
Updated weaviate.Client ()
# Initialize Weaviate client for the embedded instance client = weaviate.Client( embedded_options=EmbeddedOptions() )27ba167 -
Update requirements.txt
0129317 -
Update requirements.txt
dfe2e05 -
added weaviate
91e60c0 -
added embedded weaviate client and ingest_data + query_weaviate functions
from copy import deepcopy import streamlit as st import pandas as pd from io import StringIO from transformers import AutoTokenizer, AutoModelForTableQuestionAnswering import numpy as np import weaviate # Initialize TAPAS model and tokenizer tokenizer = AutoTokenizer.from_pretrained("google/tapas-large-finetuned-wtq") model = AutoModelForTableQuestionAnswering.from_pretrained("google/tapas-large-finetuned-wtq") # Initialize Weaviate client for the embedded instance client = weaviate.Client("http://localhost:8080") # Function to ingest data into Weaviate def ingest_data_to_weaviate(dataframe): for index, row in dataframe.iterrows(): obj = { "class": "YourClassName", "id": str(index), "properties": row.to_dict() } client.data_object.create(obj) # Function to query data from Weaviate def query_weaviate(question): # This is a basic example; adapt the query based on the question results = client.query.get('YourClass…0e62360
-
Update app.py
45ee012 -
Update app.py
66f9f66 -
Update app.py
072f6c1 -
Update app.py
d133a84 -
Update app.py
af37abc -
Update app.py
3a49d30 -
more iloc errors and (str)
The iloc operation seems to be returning a single value (in this case, a string) rather than a Series or DataFrame. This is why you're seeing the error 'str' object has no attribute 'values'. The error iloc cannot enlarge its target object suggests that we're trying to access an index that might be out of bounds. Based on these issues, I propose the following adjustments: Replace .values with .item() for scalar values, which will safely convert single values to their respective native Python types. Add some additional checks and logging to understand the shape and type of data you're working with.515be2e