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

it's that a dead loop??? #81

Open
IronSpiderMan opened this issue Oct 19, 2023 · 1 comment
Open

it's that a dead loop??? #81

IronSpiderMan opened this issue Oct 19, 2023 · 1 comment

Comments

@IronSpiderMan
Copy link

i find a piece of code in training_prepare.py, this is the code:

    loop = 1
    while 1:
        filename = uuid.uuid4().hex + '.npy'
        file_name = os.path.join(output, filename)
        text = ''
        while not len(text) > 0:
            text = random_split_chunk(loaded_data)  # Obtain a short chunk of text
            text = text.strip()
        print(f'{loop} Generating semantics for text:', text)
        loop+=1 
        semantics = text_to_semantic(text, temp=round(random.uniform(0.6, 0.8), ndigits=2))
        numpy.save(file_name, semantics)

it's that a dead loop???

@IronSpiderMan
Copy link
Author

this the full function:

def prepare_semantics_from_text(num_generations):
    loaded_data = load_books(True)

    use_gpu = not os.environ.get("BARK_FORCE_CPU", False)

    print('Loading semantics model')
    load_model(use_gpu=use_gpu, use_small=False, force_reload=False, model_type='text')

    if not os.path.isdir(output):
        os.mkdir(output)

    loop = 1
    while 1:
        filename = uuid.uuid4().hex + '.npy'
        file_name = os.path.join(output, filename)
        text = ''
        while not len(text) > 0:
            text = random_split_chunk(loaded_data)  # Obtain a short chunk of text
            text = text.strip()
        print(f'{loop} Generating semantics for text:', text)
        loop+=1 
        semantics = text_to_semantic(text, temp=round(random.uniform(0.6, 0.8), ndigits=2))
        numpy.save(file_name, semantics)

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

No branches or pull requests

1 participant