Spaces:
Sleeping
Sleeping
Update document_scrapped.py
Browse files- document_scrapped.py +1 -13
document_scrapped.py
CHANGED
|
@@ -16,19 +16,7 @@ from pdfminer.converter import TextConverter
|
|
| 16 |
from io import StringIO
|
| 17 |
from pdfminer.layout import LAParams
|
| 18 |
from pdfminer.pdfpage import PDFPage
|
| 19 |
-
|
| 20 |
-
create_react_agent,
|
| 21 |
-
AgentExecutor,
|
| 22 |
-
tool,
|
| 23 |
-
)
|
| 24 |
-
from langchain import hub
|
| 25 |
-
from langchain.tools.base import StructuredTool
|
| 26 |
-
from langchain.agents import initialize_agent
|
| 27 |
-
from langchain.prompts import StringPromptTemplate
|
| 28 |
-
from langchain_core.output_parsers import StrOutputParser
|
| 29 |
-
from unidecode import unidecode
|
| 30 |
-
from langchain_huggingface import HuggingFaceEndpoint
|
| 31 |
-
import os
|
| 32 |
def trim_input_words(input_str, max_new_tokens = 512, max_total_tokens=32768):
|
| 33 |
words = input_str.split()
|
| 34 |
max_input_tokens = max_total_tokens - max_new_tokens
|
|
|
|
| 16 |
from io import StringIO
|
| 17 |
from pdfminer.layout import LAParams
|
| 18 |
from pdfminer.pdfpage import PDFPage
|
| 19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
def trim_input_words(input_str, max_new_tokens = 512, max_total_tokens=32768):
|
| 21 |
words = input_str.split()
|
| 22 |
max_input_tokens = max_total_tokens - max_new_tokens
|