Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -158,7 +158,7 @@ if uploaded_files:
|
|
158 |
chunkdf = []
|
159 |
for i, chunk in enumerate(text_chunk):
|
160 |
inp = chunk
|
161 |
-
df = pd.DataFrame(literal_eval(str(json.dumps(tablex_chain.run(inp)[0])).replace("\'",
|
162 |
# df = pd.DataFrame(repair_json(tablex_chain.run(inp)[0]))
|
163 |
chunkdf.append(df)
|
164 |
|
@@ -193,7 +193,7 @@ if uploaded_files:
|
|
193 |
loader = TextLoader(text_file_path)
|
194 |
documents = loader.load()
|
195 |
# split it into chunks
|
196 |
-
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200,
|
197 |
docs = text_splitter.split_documents(documents)
|
198 |
embeddings = OpenAIEmbeddings()
|
199 |
|
@@ -613,7 +613,7 @@ if uploaded_files:
|
|
613 |
chunkdf = []
|
614 |
for i, chunk in enumerate(text_chunk):
|
615 |
inp = chunk
|
616 |
-
df = pd.DataFrame(literal_eval(str(json.dumps(tablex_chain.run(inp)[0])).replace("\'",
|
617 |
chunkdf.append(df)
|
618 |
|
619 |
concat = pd.concat(chunkdf, axis=0).reset_index().drop('index', axis=1).fillna('')
|
@@ -647,7 +647,7 @@ if uploaded_files:
|
|
647 |
loader = TextLoader(text_file_path)
|
648 |
documents = loader.load()
|
649 |
# split it into chunks
|
650 |
-
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200,
|
651 |
docs = text_splitter.split_documents(documents)
|
652 |
embeddings = OpenAIEmbeddings()
|
653 |
|
|
|
158 |
chunkdf = []
|
159 |
for i, chunk in enumerate(text_chunk):
|
160 |
inp = chunk
|
161 |
+
df = pd.DataFrame(literal_eval(str(json.dumps(tablex_chain.run(inp)[0])).replace("\'", '\"')), index=[0]).fillna('')
|
162 |
# df = pd.DataFrame(repair_json(tablex_chain.run(inp)[0]))
|
163 |
chunkdf.append(df)
|
164 |
|
|
|
193 |
loader = TextLoader(text_file_path)
|
194 |
documents = loader.load()
|
195 |
# split it into chunks
|
196 |
+
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200, separator="\n")
|
197 |
docs = text_splitter.split_documents(documents)
|
198 |
embeddings = OpenAIEmbeddings()
|
199 |
|
|
|
613 |
chunkdf = []
|
614 |
for i, chunk in enumerate(text_chunk):
|
615 |
inp = chunk
|
616 |
+
df = pd.DataFrame(literal_eval(str(json.dumps(tablex_chain.run(inp)[0])).replace("\'", '\"')), index=[0]).fillna('')
|
617 |
chunkdf.append(df)
|
618 |
|
619 |
concat = pd.concat(chunkdf, axis=0).reset_index().drop('index', axis=1).fillna('')
|
|
|
647 |
loader = TextLoader(text_file_path)
|
648 |
documents = loader.load()
|
649 |
# split it into chunks
|
650 |
+
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200, separator="\n")
|
651 |
docs = text_splitter.split_documents(documents)
|
652 |
embeddings = OpenAIEmbeddings()
|
653 |
|