Browse Source

Use noqa to suppess warnings of imports

tags/v0.3.9-rc1
haixuantao 1 year ago
parent
commit
30f0545ebd
2 changed files with 11 additions and 8 deletions
  1. +6
    -8
      node-hub/dora-distil-whisper/dora_distil_whisper/main.py
  2. +5
    -0
      node-hub/dora-distil-whisper/pyproject.toml

+ 6
- 8
node-hub/dora-distil-whisper/dora_distil_whisper/main.py View File

@@ -1,15 +1,15 @@
from dora import Node
import pyarrow as pa
import os
import sys
from pathlib import Path

import pyarrow as pa
import torch
from dora import Node

DEFAULT_PATH = "openai/whisper-large-v3-turbo"
TARGET_LANGUAGE = os.getenv("TARGET_LANGUAGE", "chinese")
TARGET_LANGUAGE = os.getenv("TARGET_LANGUAGE", "english")
TRANSLATE = bool(os.getenv("TRANSLATE", "False") in ["True", "true"])

import torch


def load_model():
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
@@ -47,9 +47,7 @@ def load_model():


def load_model_mlx():
from lightning_whisper_mlx import (
LightningWhisperMLX,
) # pylint: disable=import-error
from lightning_whisper_mlx import LightningWhisperMLX # noqa

whisper = LightningWhisperMLX(model="distil-large-v3", batch_size=12, quant=None)
return whisper


+ 5
- 0
node-hub/dora-distil-whisper/pyproject.toml View File

@@ -26,6 +26,11 @@ lightning-whisper-mlx = { version = "^0.0.10", platform = "darwin" }
[tool.poetry.scripts]
dora-distil-whisper = "dora_distil_whisper.main:main"

[tool.poetry.dev-dependencies]
pytest = ">= 6.3.4"
pylint = ">= 3.3.2"
black = ">= 22.10"

[build-system]
requires = ["poetry-core>=1.8.0"]
build-backend = "poetry.core.masonry.api"

Loading…
Cancel
Save