This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from transformers import MoonshineForConditionalGeneration, AutoProcessor | |
| from tqdm import tqdm | |
| import json | |
| device = "cuda:0" if torch.cuda.is_available() else "cpu" | |
| torch_dtype = torch.float32 | |
| attn_implementation = "sdpa" | |
| model = MoonshineForConditionalGeneration.from_pretrained("UsefulSensors/moonshine-tiny", attn_implementation=attn_implementation).to(device, torch_dtype) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import evaluate | |
| from transformers.models.whisper.english_normalizer import EnglishTextNormalizer | |
| from transformers import MoonshineForConditionalGeneration, AutoProcessor, WhisperProcessor | |
| from datasets import load_dataset, Audio | |
| from tqdm import tqdm | |
| import json | |
| wer_metric = evaluate.load("wer") | |
| device = "cuda:0" if torch.cuda.is_available() else "cpu" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OPENAI_SRC_PATH = "/admin/home/eustache_lebihan/dev/benchmark-whisper/whisper-myfork" | |
| import sys | |
| sys.path.insert(0, OPENAI_SRC_PATH) | |
| import wandb | |
| from tqdm import tqdm | |
| import evaluate | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OPENAI_SRC_PATH = "/admin/home/eustache_lebihan/dev/benchmark-whisper/whisper" | |
| import sys | |
| sys.path.insert(0, OPENAI_SRC_PATH) | |
| import wandb | |
| from tqdm import tqdm | |
| import evaluate | |
| import os | |
| import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TRANSFORMERS_SRC_PATH = "/admin/home/eustache_lebihan/dev/benchmark-whisper/transformers-fix/src" | |
| import sys | |
| sys.path.insert(0, TRANSFORMERS_SRC_PATH) | |
| import wandb | |
| from tqdm import tqdm | |
| import evaluate | |
| import os | |
| import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import torch | |
| import time | |
| from parler_tts import ParlerTTSForConditionalGeneration, ParlerTTSStreamer | |
| from transformers import AutoTokenizer | |
| from threading import Thread | |
| # caching allows ~50% compilation time reduction | |
| # see https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit#heading=h.o2asbxsrp1ma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import torch | |
| import time | |
| from parler_tts import ParlerTTSForConditionalGeneration, ParlerTTSStreamer | |
| from transformers import AutoTokenizer | |
| from threading import Thread | |
| # caching allows ~50% compilation time reduction | |
| # see https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit#heading=h.o2asbxsrp1ma | |
| CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import torch | |
| import soundfile as sf | |
| from parler_tts import ParlerTTSForConditionalGeneration | |
| from transformers import AutoTokenizer | |
| # caching allows ~50% compilation time reduction | |
| # see https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit#heading=h.o2asbxsrp1ma | |
| CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) | |
| os.environ["TORCHINDUCTOR_CACHE_DIR"] = os.path.join(CURRENT_DIR, "tmp") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import soundfile as sf | |
| from parler_tts import ParlerTTSForConditionalGeneration | |
| from transformers import AutoTokenizer | |
| model_name = "ylacombe/parler-tts-mini-jenny-30H" | |
| torch_device = "cuda:0" | |
| torch_dtype = torch.bfloat16 | |
| attn_implementation = "eager" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import torch | |
| import soundfile as sf | |
| from parler_tts import ParlerTTSForConditionalGeneration | |
| from transformers import AutoTokenizer | |
| # caching allows ~50% compilation time reduction | |
| # see https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit#heading=h.o2asbxsrp1ma | |
| CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) | |
| os.environ["TORCHINDUCTOR_CACHE_DIR"] = os.path.join(CURRENT_DIR, "tmp") |