Spaces:
Build error

andreska commited on
Commit
2a445d0
·
verified ·
1 Parent(s): 93cfa6a

Fixed problem with non-used dataset, non indented return and read_docx not accepting string

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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("Adrega_P.I._User_Manual.docx"):
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"]
 
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"]