Spaces:
Running
Running
marcellopoliti
commited on
Commit
•
73a1ad4
1
Parent(s):
c5a0a6e
feat: create empty collecction
Browse files
pages/create_knowledge_box.py
CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
|
|
2 |
from app import client, default_embedding_function
|
3 |
import pandas as pd
|
4 |
from generate_kb import generate_knowledge_box_from_url
|
|
|
5 |
|
6 |
# Title of the app
|
7 |
st.title("Create a knowledge box from CSV file")
|
@@ -10,6 +11,14 @@ st.title("Create a knowledge box from CSV file")
|
|
10 |
uploaded_file = st.file_uploader("Choose a CSV file", type=["csv"])
|
11 |
df = None
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
if uploaded_file is not None:
|
14 |
try:
|
15 |
df = pd.read_csv(uploaded_file)
|
|
|
2 |
from app import client, default_embedding_function
|
3 |
import pandas as pd
|
4 |
from generate_kb import generate_knowledge_box_from_url
|
5 |
+
from utils import get_chroma_client
|
6 |
|
7 |
# Title of the app
|
8 |
st.title("Create a knowledge box from CSV file")
|
|
|
11 |
uploaded_file = st.file_uploader("Choose a CSV file", type=["csv"])
|
12 |
df = None
|
13 |
|
14 |
+
collection_name = st.text_input(label="empy collection name")
|
15 |
+
if st.button("create empty knowledge box"):
|
16 |
+
client = get_chroma_client()
|
17 |
+
collection = client.create_collection(name=collection_name)
|
18 |
+
st.success("collection created")
|
19 |
+
st.write(collection)
|
20 |
+
|
21 |
+
|
22 |
if uploaded_file is not None:
|
23 |
try:
|
24 |
df = pd.read_csv(uploaded_file)
|