Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import PyPDF2
|
|
4 |
import pandas as pd
|
5 |
import openai
|
6 |
import docx
|
|
|
7 |
from langchain_community.embeddings import OpenAIEmbeddings
|
8 |
from langchain_community.vectorstores import FAISS
|
9 |
from langchain_community.llms import OpenAI
|
@@ -79,7 +80,7 @@ def get_text_from_docx(docx_files):
|
|
79 |
text = ""
|
80 |
for docx_path in docx_files:
|
81 |
print(f"Reading DOCX file: {docx_path}") # Debugging log
|
82 |
-
doc =
|
83 |
for para in doc.paragraphs:
|
84 |
text += para.text + "\n"
|
85 |
return text
|
@@ -140,4 +141,4 @@ demo = gr.Interface(
|
|
140 |
outputs=gr.Textbox(label="Answer")
|
141 |
)
|
142 |
|
143 |
-
demo.launch()
|
|
|
4 |
import pandas as pd
|
5 |
import openai
|
6 |
import docx
|
7 |
+
from docx import Document
|
8 |
from langchain_community.embeddings import OpenAIEmbeddings
|
9 |
from langchain_community.vectorstores import FAISS
|
10 |
from langchain_community.llms import OpenAI
|
|
|
80 |
text = ""
|
81 |
for docx_path in docx_files:
|
82 |
print(f"Reading DOCX file: {docx_path}") # Debugging log
|
83 |
+
doc = Document(docx_path)
|
84 |
for para in doc.paragraphs:
|
85 |
text += para.text + "\n"
|
86 |
return text
|
|
|
141 |
outputs=gr.Textbox(label="Answer")
|
142 |
)
|
143 |
|
144 |
+
demo.launch()
|