Spaces:
Sleeping
Sleeping
Qifan Zhang
commited on
Commit
·
d487adb
1
Parent(s):
d374752
update type
Browse files- utils/chatgpt.py +1 -1
- utils/read_pdf.py +3 -1
utils/chatgpt.py
CHANGED
@@ -3,7 +3,7 @@ import tiktoken
|
|
3 |
|
4 |
|
5 |
class ChatGPTAPI:
|
6 |
-
def __init__(self, api_key='', max_input_length=1024):
|
7 |
if not api_key:
|
8 |
try:
|
9 |
api_key = open('data/api_key.txt', 'r').read()
|
|
|
3 |
|
4 |
|
5 |
class ChatGPTAPI:
|
6 |
+
def __init__(self, api_key: str = '', max_input_length: int = 1024):
|
7 |
if not api_key:
|
8 |
try:
|
9 |
api_key = open('data/api_key.txt', 'r').read()
|
utils/read_pdf.py
CHANGED
@@ -1,7 +1,9 @@
|
|
|
|
|
|
1 |
import pypdf
|
2 |
|
3 |
|
4 |
-
def read_pdf(filepath) ->
|
5 |
outputs = []
|
6 |
with open(filepath, 'rb') as f:
|
7 |
pdf_reader = pypdf.PdfReader(f)
|
|
|
1 |
+
from typing import List
|
2 |
+
|
3 |
import pypdf
|
4 |
|
5 |
|
6 |
+
def read_pdf(filepath: str) -> List[str]:
|
7 |
outputs = []
|
8 |
with open(filepath, 'rb') as f:
|
9 |
pdf_reader = pypdf.PdfReader(f)
|