ClipsAI / clipsai

Clips AI is an open-source Python library that automatically converts long videos into clips.
https://www.clipsai.com
MIT License
156 stars 26 forks source link

NameError: name 'clips' is not defined #2

Open edmoartist opened 9 months ago

edmoartist commented 9 months ago

Not sure what I'm doing wrong, any help would be much appreciated, cheers.

from clipsai import ClipFinder, Transcriber [nltk_data] Downloading package punkt to [nltk_data] C:\Users\61429\AppData\Roaming\nltk_data... [nltk_data] Package punkt is already up-to-date! Traceback (most recent call last): File "", line 1, in File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\clipsai__init.py", line 7, in from .resize.resize import resize File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\clipsai\resize\resize.py", line 13, in from clipsai.diarize.pyannote import PyannoteDiarizer File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\clipsai\diarize\pyannote.py", line 27, in from pyannote.audio import Pipeline File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pyannote\audio__init.py", line 29, in from .core.inference import Inference File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pyannote\audio\core\inference.py", line 34, in from pytorch_lightning.utilities.memory import is_oom_error File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pytorch_lightning__init.py", line 35, in from pytorch_lightning.callbacks import Callback # noqa: E402 File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pytorch_lightning\callbacks__init__.py", line 14, in from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py", line 24, in from pytorch_lightning.callbacks.callback import Callback File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pytorch_lightning\callbacks\callback.py", line 25, in from pytorch_lightning.utilities.types import STEP_OUTPUT File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\pytorch_lightning\utilities\types.py", line 27, in from torchmetrics import Metric File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics__init.py", line 14, in from torchmetrics import functional # noqa: E402 File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\functional\init.py", line 14, in from torchmetrics.functional.audio._deprecated import _permutation_invariant_training as permutation_invariant_training File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\functional\audio\init__.py", line 14, in from torchmetrics.functional.audio.pit import permutation_invariant_training, pit_permutate File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\functional\audio\pit.py", line 23, in from torchmetrics.utilities import rank_zero_warn File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\utilities\init.py", line 14, in from torchmetrics.utilities.checks import check_forward_full_state_property File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\utilities\checks.py", line 25, in from torchmetrics.metric import Metric File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\metric.py", line 30, in <m File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchmetrics\utilities\data.py", line 22, in from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_12, _XLA_AVAILABLE e 48, in _TORCHAUDIO_GREATER_EQUAL_0_10: Optional[bool] = compare_version("torchaudio", operator.ge, "0.10.0") File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\lightning_utilities\core\imports.py", line 73, in compare_version return _bootstrap._gcd_import(name[level:], package, level) File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio\init__.py", line 1, in File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio_extension\init__.py", line 43, in _load_lib("libtorchaudio") torch.ops.load_library(path) File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\site-packages\torch_ops.py", line 643, in load_library File "C:\Users\61429\AppData\Local\Programs\Python\Python310\lib\ctypes\init.py", line 374, in init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'C:\Users\61429\AppData\Local\Programs\Python\Python310\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

transcriber = Transcriber() Traceback (most recent call last): File "", line 1, in NameError: name 'Transcriber' is not defined transcription = transcriber.transcribe(audio_file_path="C:\Users\61429\Desktop\tst.mp4") File "", line 1 transcription = transcriber.transcribe(audio_file_path="C:\Users\61429\Desktop\tst.mp4") ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

clipfinder = ClipFinder() Traceback (most recent call last): File "", line 1, in NameError: name 'ClipFinder' is not defined clips = clipfinder.find_clips(transcription=transcription) Traceback (most recent call last): File "", line 1, in NameError: name 'clipfinder' is not defined

print("StartTime: ", clips[0].start_time) Traceback (most recent call last): File "", line 1, in NameError: name 'clips' is not defined print("EndTime: ", clips[0].end_time)