Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated custom_model now managed by session, fixed various bugs #97

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

ROBERT-MCDOWELL
Copy link
Collaborator

Check if the issue you had from your last test is solved with this PR

@DrewThomasson
Copy link
Owner

Kk gimmi a sec...

@DrewThomasson DrewThomasson merged commit 82793bd into DrewThomasson:v2.0 Dec 21, 2024
@DrewThomasson
Copy link
Owner

yeah it works again but the hashes are identical for the two models again tho

the David attenburo and the std xtts model

as you can see here :/

Last login: Sat Dec 21 19:04:40 on ttys005
(base) drew@wmughal-CN4D09397T ~ % cmp -b /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth

(base) drew@wmughal-CN4D09397T ~ % cmp -l /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth

(base) drew@wmughal-CN4D09397T ~ % ls -l /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth

-rw-r--r--  1 drew  staff  1867929118 Dec 21 19:11 /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth
-rw-r--r--  1 drew  staff  1867929118 Dec 21 19:07 /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth
(base) drew@wmughal-CN4D09397T ~ % shasum -a 256 /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth

c7ea20001c6a0a841c77e252d8409f6a74fb423e79b3206a0771ba5989776187  /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--xtts_v2/model.pth
c7ea20001c6a0a841c77e252d8409f6a74fb423e79b3206a0771ba5989776187  /Users/drew/ebook2audiobook/models/tts/tts_models--multilingual--multi-dataset--drewThomasson/fineTunedTTSModels/xtts-v2/eng/DavidAttenborough/model.pth
(base) drew@wmughal-CN4D09397T ~ % 

@DrewThomasson
Copy link
Owner

I think were just going to have to download the model files like this,

from huggingface_hub import hf_hub_download

# Specify the repo ID and subdirectory
repo_id = "username/repo-name"
subdir = "subfolder_name"
files = ["model.pth", "vocab.json", "config.json"]

# Download files from the subdirectory
for file_name in files:
    file_path = f"{subdir}/{file_name}"
    local_file_path = hf_hub_download(repo_id=repo_id, filename=file_path)
    print(f"Downloaded {file_name} to {local_file_path}")

@DrewThomasson
Copy link
Owner

seems easier and still flexible as you can have all the data about every model in the config.py file?

:/ :)

@DrewThomasson
Copy link
Owner

Example for David Attenburo as well as the standard model

from huggingface_hub import hf_hub_download

# Specify the repo ID and subdirectory
repo_id = "drewThomasson/fineTunedTTSModels"
subdir = "xtts-v2/eng/DavidAttenborough"
files = ["model.pth", "vocab.json", "config.json"]

# Download files from the subdirectory
for file_name in files:
    file_path = f"{subdir}/{file_name}"
    local_file_path = hf_hub_download(repo_id=repo_id, filename=file_path)
    print(f"Downloaded {file_name} to {local_file_path}")

@DrewThomasson
Copy link
Owner

I can try to implement it on my end if you want

@DrewThomasson
Copy link
Owner

Once we get this working I'll be able to merge it cause the readme is pretty much set along with the other winning features of v2.0
:)

@agentxan
Copy link

When I try to use the --headless option I get the following error.

A subdirectory or file C:\Windows\Temp\Calibre already exists.
processed file: C:\Windows\Temp\Calibre
Successfully processed 1 files; Failed processing 0 files
Running in native mode
Package requirements ok
Dictionary ok
convert_ebook() Exception: 'Namespace' object does not support item assignment
Conversion failed: 'Namespace' object does not support item assignment

@ROBERT-MCDOWELL
Copy link
Collaborator Author

  1. issue: from gui/headless? are you using David from fine-tuned or custom model?

@agentxan
Copy link

agentxan commented Dec 22, 2024

if I use gui it works.
ebook2audiobook.cmd --headless --device gpu --ebook D:\ebooktest\test_eng.azw3

I look and it seems to be where the args are passed to convert_ebook
if convert_ebook(args) is changed to convert_ebook(vars(args)) it seems to work but then get

convert_ebook() Exception: The fine tuned model does not exist.
Conversion failed: The fine tuned model does not exist.

It looks like these two options are reversed

parser.add_argument(options[16], type=str, default=default_fine_tuned,
                    help='Name of the fine tuned model. Optional, uses the standard model according to the TTS engine and language.')
parser.add_argument(options[17], action='store_true',
                    help='Enable splitting text into sentences. Default to False.')

If those are swapped then the headless command works

@ROBERT-MCDOWELL
Copy link
Collaborator Author

ok I fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants