Yoma commited on
Commit
a6c14c5
·
1 Parent(s): 4c4bf31

Add pre-built ChromaDB with Git LFS

Browse files
Files changed (36) hide show
  1. .gitattributes +1 -0
  2. .gitignore +1 -1
  3. chatbot_app.py +22 -22
  4. chroma_db/0da15fc3-0924-4712-b638-2309a382e723/data_level0.bin +3 -0
  5. chroma_db/0da15fc3-0924-4712-b638-2309a382e723/header.bin +3 -0
  6. chroma_db/0da15fc3-0924-4712-b638-2309a382e723/length.bin +3 -0
  7. chroma_db/0da15fc3-0924-4712-b638-2309a382e723/link_lists.bin +0 -0
  8. chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/data_level0.bin +3 -0
  9. chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/header.bin +3 -0
  10. chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/length.bin +3 -0
  11. chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/link_lists.bin +0 -0
  12. chroma_db/61f02238-6a97-4900-958e-5e359385765c/data_level0.bin +3 -0
  13. chroma_db/61f02238-6a97-4900-958e-5e359385765c/header.bin +3 -0
  14. chroma_db/61f02238-6a97-4900-958e-5e359385765c/length.bin +3 -0
  15. chroma_db/61f02238-6a97-4900-958e-5e359385765c/link_lists.bin +0 -0
  16. chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/data_level0.bin +3 -0
  17. chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/header.bin +3 -0
  18. chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/length.bin +3 -0
  19. chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/link_lists.bin +0 -0
  20. chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/data_level0.bin +3 -0
  21. chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/header.bin +3 -0
  22. chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/length.bin +3 -0
  23. chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/link_lists.bin +0 -0
  24. chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/data_level0.bin +3 -0
  25. chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/header.bin +3 -0
  26. chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/length.bin +3 -0
  27. chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/link_lists.bin +0 -0
  28. chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/data_level0.bin +3 -0
  29. chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/header.bin +3 -0
  30. chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/length.bin +3 -0
  31. chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/link_lists.bin +0 -0
  32. chroma_db/chroma.sqlite3 +3 -0
  33. chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/data_level0.bin +3 -0
  34. chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/header.bin +3 -0
  35. chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/length.bin +3 -0
  36. chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/link_lists.bin +0 -0
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ chroma_db/** filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -16,6 +16,6 @@ __pycache__/
16
  *.env
17
  .env.local
18
 
19
- chroma_db/
20
 
21
  misc/chatgpt_chatbot_compare.md
 
16
  *.env
17
  .env.local
18
 
19
+ #chroma_db/
20
 
21
  misc/chatgpt_chatbot_compare.md
chatbot_app.py CHANGED
@@ -19,30 +19,30 @@ EMBEDDING_MODEL = 'BAAI/bge-large-en-v1.5'
19
  PRODUCTS_JSON_PATH = 'products.json'
20
  REVIEWS_JSON_PATH = 'product_reviews.json'
21
 
22
- # --- Check for and Build VectorDB if it doesn't exist ---
23
- # This is crucial for environments like HF Spaces where the file system is ephemeral.
24
- if not os.path.exists(DB_PATH):
25
- logger.info(f"ChromaDB path '{DB_PATH}' not found. Running ETL pipeline to create and populate the database.")
26
- logger.info("This may take a few moments...")
27
 
28
- # Check if data files exist before running ETL
29
- if not os.path.exists(PRODUCTS_JSON_PATH) or not os.path.exists(REVIEWS_JSON_PATH):
30
- logger.error(f"FATAL: Required data files ('{PRODUCTS_JSON_PATH}' or '{REVIEWS_JSON_PATH}') not found.")
31
- # Exit if data is missing, as the app cannot function
32
- exit()
33
 
34
- try:
35
- run_etl_pipeline(
36
- products_file=PRODUCTS_JSON_PATH,
37
- reviews_file=REVIEWS_JSON_PATH,
38
- db_path=DB_PATH,
39
- model_name=EMBEDDING_MODEL
40
- )
41
- logger.info("ETL pipeline completed successfully.")
42
- except Exception as e:
43
- logger.error(f"FATAL: An error occurred during the ETL pipeline: {e}", exc_info=True)
44
- # Exit if the ETL fails, as the app cannot function
45
- exit()
46
 
47
  # 1. Instantiate the retrieval manager
48
  # It will now connect to the newly created or existing database
 
19
  PRODUCTS_JSON_PATH = 'products.json'
20
  REVIEWS_JSON_PATH = 'product_reviews.json'
21
 
22
+ # # --- Check for and Build VectorDB if it doesn't exist ---
23
+ # # This is crucial for environments like HF Spaces where the file system is ephemeral.
24
+ # if not os.path.exists(DB_PATH):
25
+ # logger.info(f"ChromaDB path '{DB_PATH}' not found. Running ETL pipeline to create and populate the database.")
26
+ # logger.info("This may take a few moments...")
27
 
28
+ # # Check if data files exist before running ETL
29
+ # if not os.path.exists(PRODUCTS_JSON_PATH) or not os.path.exists(REVIEWS_JSON_PATH):
30
+ # logger.error(f"FATAL: Required data files ('{PRODUCTS_JSON_PATH}' or '{REVIEWS_JSON_PATH}') not found.")
31
+ # # Exit if data is missing, as the app cannot function
32
+ # exit()
33
 
34
+ # try:
35
+ # run_etl_pipeline(
36
+ # products_file=PRODUCTS_JSON_PATH,
37
+ # reviews_file=REVIEWS_JSON_PATH,
38
+ # db_path=DB_PATH,
39
+ # model_name=EMBEDDING_MODEL
40
+ # )
41
+ # logger.info("ETL pipeline completed successfully.")
42
+ # except Exception as e:
43
+ # logger.error(f"FATAL: An error occurred during the ETL pipeline: {e}", exc_info=True)
44
+ # # Exit if the ETL fails, as the app cannot function
45
+ # exit()
46
 
47
  # 1. Instantiate the retrieval manager
48
  # It will now connect to the newly created or existing database
chroma_db/0da15fc3-0924-4712-b638-2309a382e723/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70b7bdb12ce92dc59b93140168c5f4101b1decf1df81c18bf841e0e8725bc2d6
3
+ size 423600
chroma_db/0da15fc3-0924-4712-b638-2309a382e723/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/0da15fc3-0924-4712-b638-2309a382e723/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e33b3f782b2684d51b5db27adeab5246d04fddc3d67d152d9c87348c27abd251
3
+ size 400
chroma_db/0da15fc3-0924-4712-b638-2309a382e723/link_lists.bin ADDED
File without changes
chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f03373849efd9fea6a17a8ace64bb9c8a4ca99ff1b2cf9e361ea5d8d878576e
3
+ size 423600
chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aad023b7805cd4c49ad1f1124566df7323df683680ad4b74cb4aa9c2d7531270
3
+ size 400
chroma_db/2b05517c-4ec8-4591-9082-12e41c2b4efc/link_lists.bin ADDED
File without changes
chroma_db/61f02238-6a97-4900-958e-5e359385765c/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9e20d648c0620651b9da186b28c5c5e00c6a6667ff94f538b52543d9952be98
3
+ size 423600
chroma_db/61f02238-6a97-4900-958e-5e359385765c/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/61f02238-6a97-4900-958e-5e359385765c/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65ec6c4954d96590d9056a6982b079008a39d8127ba562f88f873fdbf501a471
3
+ size 400
chroma_db/61f02238-6a97-4900-958e-5e359385765c/link_lists.bin ADDED
File without changes
chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3d6fa3ff81b69529965d9d2fcab9b7caa5acc50583a0a93d16927e946e770ce
3
+ size 423600
chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a12e561363385e9dfeeab326368731c030ed4b374e7f5897ac819159d2884c5
3
+ size 400
chroma_db/6929eb9c-1c91-4b2f-9703-01d80dc43efa/link_lists.bin ADDED
File without changes
chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8108bbabf1b315b5068e0ba1ca4c17467547bd54abe38702e86a0678e5d0e866
3
+ size 423600
chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32843c07af594c51c31d2098067ff3e4d23d64626a4a0f8536248a2326cbf54e
3
+ size 400
chroma_db/8e1ca6b3-2613-4ea5-9001-290b40b8cc2e/link_lists.bin ADDED
File without changes
chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38dfa2e50819b3cb2db4b6c2380a60a719fc5fae3d297abf6358cf2fb1e2bdd2
3
+ size 423600
chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d5960bbd4ef0de1acfcc6340298635b454ea9aa2c05a83471a12b5712cc53a1
3
+ size 400
chroma_db/91e6e6a9-9bed-46de-b536-4e588f2c0bfa/link_lists.bin ADDED
File without changes
chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fc1f7dab7b0f0e004eb4c958aa08a81b43b7d333f498121b22b9f1d8e74043e
3
+ size 423600
chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63f7e3bd5af6a9f95bc59817a18f2d7afd54ea8fe4e12887fee7059024e30334
3
+ size 400
chroma_db/c81595a2-94ca-4a8e-9c00-b5e9e3ca300d/link_lists.bin ADDED
File without changes
chroma_db/chroma.sqlite3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f83dc1ed2dd2ee0c682eb19e7302d473e55073aa0c4a3eba96885812e41f5fa
3
+ size 7536640
chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8b79689c0d7f5a3d8395e34ad83b2e94539a2c328f5be47933cc825ee0662a3
3
+ size 423600
chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf12d4486518c7addf488cb4854526902c78e91951990e1e2f4e055cec814e5d
3
+ size 100
chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7afd75f7c516c604cfcb1c70ed84f14beea289c7f30296e7980a882606b53792
3
+ size 400
chroma_db/d612e49f-f51b-4113-8d3e-b8bd573a98fa/link_lists.bin ADDED
File without changes