Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add a pkg to requirement.txt #2

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

e7217
Copy link
Contributor

@e7217 e7217 commented Jan 2, 2025

Hello
I have added the pycryptodome package to requirements.txt.
An error occurred due to xrange.

Marker-Inc-Korea/AutoRAG#1067

full logs

(AutoRAG-tutorial) root@840dd0934411:~/AutoRAG-tutorial# python run_parse.py 
[01/02/25 20:50:13] INFO     [__init__.py:100] >> You are using API version of AutoRAG.To use local version, run pip install    __init__.py:100
                             'AutoRAG[gpu]'                                                                                                    
                    INFO     [__init__.py:128] >> You are using API version of AutoRAG.To use local version, run pip install    __init__.py:128
                             'AutoRAG[gpu]'                                                                                                    
[01/02/25 20:50:14] ERROR    [__init__.py:60] >> Unexpected exception                                                            __init__.py:60
                             ╭─────────────────────────────── Traceback (most recent call last) ───────────────────────────────╮               
                             │ /root/AutoRAG-tutorial/run_parse.py:26 in <module>                                              │               
                             │                                                                                                 │               
                             │   23                                                                                            │               
                             │   24                                                                                            │               
                             │   25 if __name__ == '__main__':                                                                 │               
                             │ ❱ 26 │   main()                                                                                 │               
                             │   27                                                                                            │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/click/core.py:1161 in __call__        │               
                             │                                                                                                 │               
                             │   1158 │                                                                                        │               
                             │   1159 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                          │               
                             │   1160 │   │   """Alias for :meth:`main`."""                                                    │               
                             │ ❱ 1161 │   │   return self.main(*args, **kwargs)                                                │               
                             │   1162                                                                                          │               
                             │   1163                                                                                          │               
                             │   1164 class Command(BaseCommand):                                                              │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/click/core.py:1082 in main            │               
                             │                                                                                                 │               
                             │   1079 │   │   try:                                                                             │               
                             │   1080 │   │   │   try:                                                                         │               
                             │   1081 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                 │               
                             │ ❱ 1082 │   │   │   │   │   rv = self.invoke(ctx)                                                │               
                             │   1083 │   │   │   │   │   if not standalone_mode:                                              │               
                             │   1084 │   │   │   │   │   │   return rv                                                        │               
                             │   1085 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!                              │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/click/core.py:1443 in invoke          │               
                             │                                                                                                 │               
                             │   1440 │   │   │   echo(style(message, fg="red"), err=True)                                     │               
                             │   1441 │   │                                                                                    │               
                             │   1442 │   │   if self.callback is not None:                                                    │               
                             │ ❱ 1443 │   │   │   return ctx.invoke(self.callback, **ctx.params)                               │               
                             │   1444 │                                                                                        │               
                             │   1445 │   def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]: │               
                             │   1446 │   │   """Return a list of completions for the incomplete value. Looks                  │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/click/core.py:788 in invoke           │               
                             │                                                                                                 │               
                             │    785 │   │                                                                                    │               
                             │    786 │   │   with augment_usage_errors(__self):                                               │               
                             │    787 │   │   │   with ctx:                                                                    │               
                             │ ❱  788 │   │   │   │   return __callback(*args, **kwargs)                                       │               
                             │    789 │                                                                                        │               
                             │    790 │   def forward(__self, __cmd: "Command", *args: t.Any, **kwargs: t.Any) -> t.Any:       │               
                             │    791 │   │   """Similar to :meth:`invoke` but fills in default keyword                        │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/run_parse.py:22 in main                                                  │               
                             │                                                                                                 │               
                             │   19 │   │   os.makedirs(project_dir)                                                           │               
                             │   20 │                                                                                          │               
                             │   21 │   parser = Parser(data_path_glob=data_path_glob, project_dir=project_dir)                │               
                             │ ❱ 22 │   parser.start_parsing(config)                                                           │               
                             │   23                                                                                            │               
                             │   24                                                                                            │               
                             │   25 if __name__ == '__main__':                                                                 │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/parser.py:27 in start_parsing │               
                             │                                                                                                 │               
                             │   24 │   │   # load yaml file                                                                   │               
                             │   25 │   │   modules = load_yaml(yaml_path)                                                     │               
                             │   26 │   │                                                                                      │               
                             │ ❱ 27 │   │   input_modules, input_params = get_param_combinations(modules)                      │               
                             │   28 │   │                                                                                      │               
                             │   29 │   │   logger.info("Parsing Start...")                                                    │               
                             │   30 │   │   run_parser(                                                                        │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/data/utils/util.py:89 in      │               
                             │ get_param_combinations                                                                          │               
                             │                                                                                                 │               
                             │    86 def get_param_combinations(modules: List[Dict]) -> Tuple[List[Callable], List[Dict]]:     │               
                             │    87 │   module_callable_list, module_params_list = [], []                                     │               
                             │    88 │   for module in modules:                                                                │               
                             │ ❱  89 │   │   module_instance = Module.from_dict(module)                                        │               
                             │    90 │   │   module_params_list.append(module_instance.module_param)                           │               
                             │    91 │   │   module_callable_list.append(module_instance.module)                               │               
                             │    92                                                                                           │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/schema/module.py:24 in        │               
                             │ from_dict                                                                                       │               
                             │                                                                                                 │               
                             │   21 │   │   _module_dict = deepcopy(module_dict)                                               │               
                             │   22 │   │   module_type = _module_dict.pop("module_type")                                      │               
                             │   23 │   │   module_params = _module_dict                                                       │               
                             │ ❱ 24 │   │   return cls(module_type, module_params)                                             │               
                             │   25                                                                                            │               
                             │ in __init__:5                                                                                   │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/schema/module.py:15 in        │               
                             │ __post_init__                                                                                   │               
                             │                                                                                                 │               
                             │   12 │   module: Callable = field(init=False)                                                   │               
                             │   13 │                                                                                          │               
                             │   14 │   def __post_init__(self):                                                               │               
                             │ ❱ 15 │   │   self.module = get_support_modules(self.module_type)                                │               
                             │   16 │   │   if self.module is None:                                                            │               
                             │   17 │   │   │   raise ValueError(f"Module type {self.module_type} is not supported.")          │               
                             │   18                                                                                            │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/support.py:183 in             │               
                             │ get_support_modules                                                                             │               
                             │                                                                                                 │               
                             │   180 │   │   "Vllm": ("autorag.nodes.generator", "Vllm"),                                      │               
                             │   181 │   │   "OpenAILLM": ("autorag.nodes.generator", "OpenAILLM"),                            │               
                             │   182 │   }                                                                                     │               
                             │ ❱ 183 │   return dynamically_find_function(module_name, support_modules)                        │               
                             │   184                                                                                           │               
                             │   185                                                                                           │               
                             │   186 def get_support_nodes(node_name: str) -> Callable:                                        │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/support.py:8 in               │               
                             │ dynamically_find_function                                                                       │               
                             │                                                                                                 │               
                             │     5 def dynamically_find_function(key: str, target_dict: Dict) -> Callable:                   │               
                             │     6 │   if key in target_dict:                                                                │               
                             │     7 │   │   module_path, func_name = target_dict[key]                                         │               
                             │ ❱   8 │   │   module = importlib.import_module(module_path)                                     │               
                             │     9 │   │   func = getattr(module, func_name)                                                 │               
                             │    10 │   │   return func                                                                       │               
                             │    11 │   else:                                                                                 │               
                             │                                                                                                 │               
                             │ /root/.pyenv/versions/3.10.16/lib/python3.10/importlib/__init__.py:126 in import_module         │               
                             │                                                                                                 │               
                             │   123 │   │   │   if character != '.':                                                          │               
                             │   124 │   │   │   │   break                                                                     │               
                             │   125 │   │   │   level += 1                                                                    │               
                             │ ❱ 126 │   return _bootstrap._gcd_import(name[level:], package, level)                           │               
                             │   127                                                                                           │               
                             │   128                                                                                           │               
                             │   129 _RELOADING = {}                                                                           │               
                             │ in _gcd_import:1050                                                                             │               
                             │ in _find_and_load:1027                                                                          │               
                             │ in _find_and_load_unlocked:1006                                                                 │               
                             │ in _load_unlocked:688                                                                           │               
                             │ in exec_module:883                                                                              │               
                             │ in _call_with_frames_removed:241                                                                │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/autorag/data/parse/table_hybrid_parse │               
                             │ .py:6 in <module>                                                                               │               
                             │                                                                                                 │               
                             │     3 from glob import glob                                                                     │               
                             │     4 from typing import List, Tuple, Dict                                                      │               
                             │     5                                                                                           │               
                             │ ❱   6 from PyPDF2 import PdfFileReader, PdfFileWriter                                           │               
                             │     7 import pdfplumber                                                                         │               
                             │     8                                                                                           │               
                             │     9 from autorag.support import get_support_modules                                           │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/PyPDF2/__init__.py:10 in <module>     │               
                             │                                                                                                 │               
                             │    7 You can read the full docs at https://pypdf2.readthedocs.io/.                              │               
                             │    8 """                                                                                        │               
                             │    9                                                                                            │               
                             │ ❱ 10 from ._encryption import PasswordType                                                      │               
                             │   11 from ._merger import PdfFileMerger, PdfMerger                                              │               
                             │   12 from ._page import PageObject, Transformation                                              │               
                             │   13 from ._reader import DocumentInformation, PdfFileReader, PdfReader                         │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/PyPDF2/_encryption.py:60 in <module>  │               
                             │                                                                                                 │               
                             │    57                                                                                           │               
                             │    58                                                                                           │               
                             │    59 try:                                                                                      │               
                             │ ❱  60 │   from Crypto.Cipher import AES, ARC4  # type: ignore[import]                           │               
                             │    61 │   from Crypto.Util.Padding import pad  # type: ignore[import]                           │               
                             │    62 │                                                                                         │               
                             │    63 │   class CryptRC4(CryptBase):                                                            │               
                             │                                                                                                 │               
                             │ /root/AutoRAG-tutorial/.venv/lib/python3.10/site-packages/Crypto/Cipher/ARC4.py:119 in <module> │               
                             │                                                                                                 │               
                             │   116 #: Size of a data block (in bytes)                                                        │               
                             │   117 block_size = 1                                                                            │               
                             │   118 #: Size of a key (in bytes)                                                               │               
                             │ ❱ 119 key_size = xrange(1,256+1)                                                                │               
                             │   120                                                                                           │               
                             │   121                                                                                           │               
                             ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯               
                             NameError: name 'xrange' is not defined            

@vkehfdl1 vkehfdl1 merged commit e42db2d into Marker-Inc-Korea:main Jan 25, 2025
@e7217 e7217 deleted the fix/error-crypto branch February 3, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants