Spaces:
Build error
Build error
Fixed problem with non-used dataset, non indented return and read_docx not accepting string
Browse files
app.py
CHANGED
|
@@ -4,18 +4,18 @@ import docx
|
|
| 4 |
#from datasets import load_dataset
|
| 5 |
|
| 6 |
file_path = "Adrega_P.I._User_Manual.docx"
|
| 7 |
-
def read_docx(
|
| 8 |
doc = docx.Document(file_path)
|
| 9 |
text = []
|
| 10 |
for paragraph in doc.paragraphs:
|
| 11 |
text.append(paragraph.text)
|
| 12 |
-
|
| 13 |
|
| 14 |
pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
| 16 |
|
| 17 |
st.title("Adrega AI Help")
|
| 18 |
-
dataset = load_dataset("andreska/adregadocs", split="test")
|
| 19 |
context = read_docx(file_path)
|
| 20 |
#context = dataset[0]["text"]
|
| 21 |
#context = "Adrega is a very cool company, that implements AI. Rett fra Rio is a company that specializes in body waxing and is owned by Cintia" #dataset[0]["text"]
|
|
|
|
| 4 |
#from datasets import load_dataset
|
| 5 |
|
| 6 |
file_path = "Adrega_P.I._User_Manual.docx"
|
| 7 |
+
def read_docx(file_path):
|
| 8 |
doc = docx.Document(file_path)
|
| 9 |
text = []
|
| 10 |
for paragraph in doc.paragraphs:
|
| 11 |
text.append(paragraph.text)
|
| 12 |
+
return "\n".join(text)
|
| 13 |
|
| 14 |
pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
| 16 |
|
| 17 |
st.title("Adrega AI Help")
|
| 18 |
+
#dataset = load_dataset("andreska/adregadocs", split="test")
|
| 19 |
context = read_docx(file_path)
|
| 20 |
#context = dataset[0]["text"]
|
| 21 |
#context = "Adrega is a very cool company, that implements AI. Rett fra Rio is a company that specializes in body waxing and is owned by Cintia" #dataset[0]["text"]
|