From c4210d1741c4c95539f7c3025fa45f31205900a7 Mon Sep 17 00:00:00 2001 From: arxyzan Date: Sun, 27 Aug 2023 17:32:26 +0330 Subject: [PATCH] Add other libs to integrations.py --- hezar/integrations.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/hezar/integrations.py b/hezar/integrations.py index fb994f0e..8f083690 100644 --- a/hezar/integrations.py +++ b/hezar/integrations.py @@ -1,15 +1,39 @@ import importlib.util - __all__ = [ + "is_transformers_available", + "is_datasets_available", + "is_tokenizers_available", "is_soundfile_available", "is_librosa_available", + "is_wandb_available", + "is_gensim_available", ] +def is_transformers_available(): + return importlib.util.find_spec("transformers") is not None + + +def is_datasets_available(): + return importlib.util.find_spec("datasets") is not None + + +def is_tokenizers_available(): + return importlib.util.find_spec("tokenizers") is not None + + def is_soundfile_available(): return importlib.util.find_spec("soundfile") is not None def is_librosa_available(): return importlib.util.find_spec("librosa") is not None + + +def is_wandb_available(): + return importlib.util.find_spec("wandb") is not None + + +def is_gensim_available(): + return importlib.util.find_spec("gensim") is not None