Skip to content

Commit

Permalink
Add assets to release
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Jul 30, 2024
1 parent 389fd1c commit a30909c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ jobs:
run: |
python3 test.py
- name: assets
run: |
python3 assets.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: whisper.tflite
path: whisper.tflite
path: |
vocab.json
tokenizer.json
merges.txt
normalizer.json
whisper.tflite
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:

- name: zip
run: |
zip whisper.tflite-${{ github.event.release.tag_name }}.zip whisper.tflite
ls -la
zip whisper.tflite-${{ github.event.release.tag_name }}.zip whisper.tflite merges.txt normalizer.json tokenizer.json vocab.json
- name: Upload release package
uses: actions/upload-release-asset@v1
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.venv
tf_whisper_saved
*.tflite
*.tflite
merges.txt
normalizer.json
tokenizer.json
vocab.json
15 changes: 15 additions & 0 deletions assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logging
import os.path
import shutil
from settings import model_name, tflite_model_path
from transformers import WhisperProcessor, WhisperTokenizer
from transformers.utils import cached_file

logging.basicConfig(level=logging.DEBUG)

processor = WhisperProcessor.from_pretrained(model_name)
tokenizer = processor.tokenizer

for asset in [cached_file(model_name, f) for f in tokenizer.vocab_files_names.values()]:
print(os.path.basename(asset))
shutil.copy(asset, os.path.basename(asset))

0 comments on commit a30909c

Please sign in to comment.