Spaces:
Sleeping
Sleeping
| from datasets import load_dataset | |
| import lancedb | |
| import pandas as pd | |
| import shutil | |
| def inspect_and_verify(): | |
| print("--- 1. Inspecting 'odunola/bible-reference-sentence-pair' ---") | |
| try: | |
| ds = load_dataset("odunola/bible-reference-sentence-pair", split="train", streaming=True) | |
| print("Success! First 3 examples:") | |
| count = 0 | |
| for ex in ds: | |
| print(ex) | |
| count += 1 | |
| if count >= 3: | |
| break | |
| except Exception as e: | |
| print(f"Failed to load dataset: {e}") | |
| print("\n--- 2. Verifying LanceDB ---") | |
| try: | |
| db = lancedb.connect("data/lancedb_test") | |
| df = pd.DataFrame({"vector": [[1.1, 1.2], [2.1, 2.2]], "item": ["foo", "bar"]}) | |
| tbl = db.create_table("test_table", data=df, mode="overwrite") | |
| print(f"Created table. Count: {len(tbl)}") | |
| shutil.rmtree("data/lancedb_test") | |
| print("LanceDB verified.") | |
| except Exception as e: | |
| print(f"LanceDB failure: {e}") | |
| if __name__ == "__main__": | |
| inspect_and_verify() | |