Spaces:
Build error
Build error
Update summ.py
Browse files
summ.py
CHANGED
@@ -9,7 +9,7 @@ from langchain.chains.combine_documents.stuff import StuffDocumentsChain
|
|
9 |
|
10 |
os.environ['OPENAI_API_KEY'] = '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'
|
11 |
|
12 |
-
llm = ChatOpenAI(temperature=0, model_name="gpt-
|
13 |
|
14 |
def get_summ(path):
|
15 |
|
@@ -45,7 +45,7 @@ def get_summ(path):
|
|
45 |
# If documents exceed context for `StuffDocumentsChain`
|
46 |
collapse_documents_chain=combine_documents_chain,
|
47 |
# The maximum number of tokens to group documents into.
|
48 |
-
token_max=
|
49 |
)
|
50 |
|
51 |
# Combining documents by mapping a chain over them, then combining results
|
@@ -61,7 +61,7 @@ def get_summ(path):
|
|
61 |
)
|
62 |
|
63 |
text_splitter = CharacterTextSplitter.from_tiktoken_encoder(
|
64 |
-
chunk_size=
|
65 |
)
|
66 |
split_docs = text_splitter.split_documents(docs)
|
67 |
|
|
|
9 |
|
10 |
os.environ['OPENAI_API_KEY'] = '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'
|
11 |
|
12 |
+
llm = ChatOpenAI(temperature=0, model_name="gpt-4-1106-preview")
|
13 |
|
14 |
def get_summ(path):
|
15 |
|
|
|
45 |
# If documents exceed context for `StuffDocumentsChain`
|
46 |
collapse_documents_chain=combine_documents_chain,
|
47 |
# The maximum number of tokens to group documents into.
|
48 |
+
token_max=64000,
|
49 |
)
|
50 |
|
51 |
# Combining documents by mapping a chain over them, then combining results
|
|
|
61 |
)
|
62 |
|
63 |
text_splitter = CharacterTextSplitter.from_tiktoken_encoder(
|
64 |
+
chunk_size=64000, chunk_overlap=0
|
65 |
)
|
66 |
split_docs = text_splitter.split_documents(docs)
|
67 |
|