Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,8 @@ from typing import List
|
|
11 |
from together import Together
|
12 |
import pandas as pd
|
13 |
import streamlit as st
|
14 |
-
from
|
|
|
15 |
import os
|
16 |
|
17 |
|
@@ -238,7 +239,7 @@ def get_docx_index(folder_path):
|
|
238 |
for filename in os.listdir(folder_path):
|
239 |
if filename.endswith(".docx"):
|
240 |
full_path = os.path.join(folder_path, filename)
|
241 |
-
doc =
|
242 |
|
243 |
# استخراج متن تمام پاراگرافها
|
244 |
file_text = "\n".join([para.text for para in doc.paragraphs])
|
|
|
11 |
from together import Together
|
12 |
import pandas as pd
|
13 |
import streamlit as st
|
14 |
+
from langchain.docstore.document import Document
|
15 |
+
import docx
|
16 |
import os
|
17 |
|
18 |
|
|
|
239 |
for filename in os.listdir(folder_path):
|
240 |
if filename.endswith(".docx"):
|
241 |
full_path = os.path.join(folder_path, filename)
|
242 |
+
doc = docx.Document(full_path)
|
243 |
|
244 |
# استخراج متن تمام پاراگرافها
|
245 |
file_text = "\n".join([para.text for para in doc.paragraphs])
|