Преглед на файлове

support install use existing repo and relaxation of version restrictions from aistudio (#1875)

changdazhou преди 1 година
родител
ревизия
07b20faf67
променени са 3 файла, в които са добавени 17 реда и са изтрити 5 реда
  1. 7 1
      paddlex/paddlex_cli.py
  2. 7 1
      paddlex/repo_manager/core.py
  3. 3 3
      requirements.txt

+ 7 - 1
paddlex/paddlex_cli.py

@@ -54,6 +54,11 @@ def args_cfg():
         dest='reinstall',
         action='store_true',
         help="Whether to reinstall all packages.")
+    parser.add_argument(
+        '--use_local_repos',
+        action='store_true',
+        default=False,
+        help="Use local repos when installing.")
 
     ################# pipeline predict #################
     parser.add_argument('--predict', action='store_true', default=True, help="")
@@ -83,7 +88,8 @@ def install(args):
         reinstall=args.reinstall or None,
         no_deps=args.no_deps,
         platform=args.platform,
-        update_repos=args.update_repos)
+        update_repos=args.update_repos,
+        use_local_repos=args.use_local_repos)
     return
 
 

+ 7 - 1
paddlex/repo_manager/core.py

@@ -88,7 +88,8 @@ def setup(repo_names,
           no_deps=False,
           constraints=None,
           platform=None,
-          update_repos=False):
+          update_repos=False,
+          use_local_repos=False):
     """ setup """
     repo_names = list(set(_parse_repo_deps(repo_names)))
 
@@ -101,6 +102,11 @@ def setup(repo_names,
     for repo in repos:
         repo_name = repo.name
         if repo.check_repo_exiting():
+            if use_local_repos:
+                reinstall = True
+                logging.warning(
+                    f"We will use the existing repo of {repo.name}.")
+                continue
             logging.warning(f"Existing of {repo.name} repo.")
             if reinstall is None:
                 if sys.stdin.isatty():

+ 3 - 3
requirements.txt

@@ -3,9 +3,9 @@ PyYAML
 filelock
 ruamel.yaml
 chardet
-numpy==1.23.5
-matplotlib==3.5.2
-opencv-python==4.5.5.64
+numpy
+matplotlib
+opencv-python
 pycocotools
 tqdm
 pyclipper