Browse Source

Update __init__.py

pull/7/head
tin2tin 2 years ago committed by GitHub
parent
commit
76bd5cc442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      __init__.py

40
__init__.py

@ -62,34 +62,28 @@ class SequencerImportMovieOperator(Operator):
sys.path.append(app_path)
pybin = sys.executable
try:
subprocess.call([pybin, "-m", "ensurepip"])
except ImportError:
pass
import_module(self, "open_clip_torch")
import_module(self, "pytorch_lightning")
import_module(self, "gast")
import_module(self, "tensorflow")
subprocess.check_call(
[
pybin,
"-m",
"pip",
"install",
"git+https://github.com/modelscope/modelscope.git",
"--user",
]
)
try:
import modelscope
except ModuleNotFoundError:
print("Installation of the modelscope module failed")
self.report(
{"INFO"},
"Installing modelscope module failed! Try to run Blender as administrator.",
try:
subprocess.call([pybin, "-m", "ensurepip"])
except ImportError:
pass
subprocess.check_call(
[
pybin,
"-m",
"pip",
"install",
"git+https://github.com/modelscope/modelscope.git",
"--user",
]
)
return False
import_module(self, "open_clip_torch")
import_module(self, "pytorch_lightning")
import_module(self, "gast")
import_module(self, "tensorflow")
from modelscope.pipelines import pipeline
from modelscope.outputs import OutputKeys

Loading…
Cancel
Save