Commit
Β·
d32b31c
1
Parent(s):
10182d9
Update app.py
Browse files
app.py
CHANGED
@@ -48,18 +48,10 @@ def get_text_chunks(documents):
|
|
48 |
length_function=len # ν
μ€νΈμ κΈΈμ΄λ₯Ό μΈ‘μ νλ ν¨μλ₯Ό μ§μ ν©λλ€.
|
49 |
)
|
50 |
|
51 |
-
|
52 |
-
for doc in documents:
|
53 |
-
try:
|
54 |
-
text = doc.getvalue().decode("utf-8") # νμΌ λ΄μ©μ utf-8 νμμΌλ‘ λμ½λ©νμ¬ ν
μ€νΈλ‘ λ³νν©λλ€.
|
55 |
-
text_list.append(text)
|
56 |
-
except Exception as e:
|
57 |
-
print(f"An error occurred while processing a document: {e}")
|
58 |
-
|
59 |
-
# λ¬Έμλ€μ μ²ν¬λ‘ λλλλ€.
|
60 |
-
documents = text_splitter.split_documents(text_list)
|
61 |
return documents # λλ μ²ν¬λ₯Ό λ°νν©λλ€.
|
62 |
|
|
|
63 |
# ν
μ€νΈ μ²ν¬λ€λ‘λΆν° λ²‘ν° μ€ν μ΄λ₯Ό μμ±νλ ν¨μμ
λλ€.
|
64 |
def get_vectorstore(text_chunks):
|
65 |
# μνλ μλ² λ© λͺ¨λΈμ λ‘λν©λλ€.
|
|
|
48 |
length_function=len # ν
μ€νΈμ κΈΈμ΄λ₯Ό μΈ‘μ νλ ν¨μλ₯Ό μ§μ ν©λλ€.
|
49 |
)
|
50 |
|
51 |
+
documents = text_splitter.split_documents(documents) # λ¬Έμλ€μ μ²ν¬λ‘ λλλλ€.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
return documents # λλ μ²ν¬λ₯Ό λ°νν©λλ€.
|
53 |
|
54 |
+
|
55 |
# ν
μ€νΈ μ²ν¬λ€λ‘λΆν° λ²‘ν° μ€ν μ΄λ₯Ό μμ±νλ ν¨μμ
λλ€.
|
56 |
def get_vectorstore(text_chunks):
|
57 |
# μνλ μλ² λ© λͺ¨λΈμ λ‘λν©λλ€.
|