Spaces:
Runtime error
Runtime error
Paperboxiv
commited on
Commit
·
28c2240
1
Parent(s):
31aaa72
nothing changed
Browse files
app.py
CHANGED
@@ -12,18 +12,16 @@ import os
|
|
12 |
os.environ["OPENAI_API_KEY"] = "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"
|
13 |
|
14 |
|
15 |
-
|
16 |
#读取PDF文件
|
17 |
-
def doc_read_pdf(file):
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
return raw_text
|
27 |
|
28 |
# 读取txt文件
|
29 |
def doc_read_txt(file):
|
|
|
12 |
os.environ["OPENAI_API_KEY"] = "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"
|
13 |
|
14 |
|
|
|
15 |
#读取PDF文件
|
16 |
+
# def doc_read_pdf(file):
|
17 |
+
# # 读取PDF
|
18 |
+
# reader = PdfReader(file)
|
19 |
+
# raw_text = ''
|
20 |
+
# for i, page in enumerate(reader.pages):
|
21 |
+
# text = page.extract_text()
|
22 |
+
# if text:
|
23 |
+
# raw_text += text
|
24 |
+
# return raw_text
|
|
|
25 |
|
26 |
# 读取txt文件
|
27 |
def doc_read_txt(file):
|