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. 22
      __init__.py

22
__init__.py

@ -62,11 +62,18 @@ class SequencerImportMovieOperator(Operator):
sys.path.append(app_path) sys.path.append(app_path)
pybin = sys.executable pybin = sys.executable
import_module(self, "open_clip_torch")
import_module(self, "pytorch_lightning")
import_module(self, "gast")
import_module(self, "tensorflow")
try:
import modelscope
except ModuleNotFoundError:
try: try:
subprocess.call([pybin, "-m", "ensurepip"]) subprocess.call([pybin, "-m", "ensurepip"])
except ImportError: except ImportError:
pass pass
subprocess.check_call( subprocess.check_call(
[ [
pybin, pybin,
@ -77,19 +84,6 @@ class SequencerImportMovieOperator(Operator):
"--user", "--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.",
)
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.pipelines import pipeline
from modelscope.outputs import OutputKeys from modelscope.outputs import OutputKeys

Loading…
Cancel
Save