Skip to content

Commit

Permalink
Remove useless codes and add lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Changochen committed Jun 7, 2024
1 parent 9ea46e2 commit dba93f4
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 333 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
path: /home/runner/.local/share/tts
key: ${{ runner.os }}-tts

- name: Generate Prime Numbers
- name: Cache TTS models.
if: steps.cache-tts.outputs.cache-hit != 'true'
run: rm -rf /home/runner/.local/share/tts

Expand All @@ -43,5 +43,8 @@ jobs:
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: lint
run: pyright src

- name: e2e
run: echo y | slide-to-video --model ${{ matrix.model }} --slide example/slide.pdf --script example/script.txt --voice-sample-path example/sample.mp3 --output-dir output-${{ matrix.model }}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build-backend = "hatchling.build"
managed = true
dev-dependencies = [
"pyinstrument>=4.6.2",
"pyright>=1.1.366",
]

[tool.hatch.metadata]
Expand Down
12 changes: 0 additions & 12 deletions src/script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


app = typer.Typer()
app_dataset = typer.Typer()


@app.command()
Expand Down Expand Up @@ -57,16 +56,5 @@ def generate(
slide_to_video(project_config=project_config)


@app_dataset.command()
def dataset_generate(audios_path: str, output_path: str):
from slide_to_video.dataset import generate_dataset

generate_dataset(audios_path, output_path)


def main():
app()


def dataset():
app_dataset()
140 changes: 0 additions & 140 deletions src/slide_to_video/backup.py

This file was deleted.

119 changes: 0 additions & 119 deletions src/slide_to_video/dataset.py

This file was deleted.

38 changes: 0 additions & 38 deletions src/slide_to_video/load_dataset.py

This file was deleted.

8 changes: 6 additions & 2 deletions src/slide_to_video/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def content(self):
with open(self.path, "r") as f:
return f.read()

def __eq__(self, other: Item):
def __eq__(self, other: object):
if not isinstance(other, Item):
return False
return self.md5sum == other.md5sum and self.extra == other.extra

def cache(self):
Expand Down Expand Up @@ -297,7 +299,9 @@ def get_scripts(self, filter_cached=False):
return [item.content for item in self.script_items]

def build(self):
tts_engine = create_engine(self.config.get("model"), self.config)
model = self.config.get("model")
assert model
tts_engine = create_engine(model, self.config)
lock = None
if not tts_engine.parallizable():
manager = Manager()
Expand Down
18 changes: 0 additions & 18 deletions src/slide_to_video/speech_recognition.py

This file was deleted.

Loading

0 comments on commit dba93f4

Please sign in to comment.