Skip to content

Error, unable to resolve #134

@prodrumernate

Description

@prodrumernate

i have an error "UnboundLocalError: cannot access local variable 'raw_output' where it is not associated with a value"

chatgpt and gemini can not seem to figure out what is wrong as their fixes make things worse.

YuE for windows
gtx 1070 ( i know i need something more, eventually i will )
windows 11
(ask for any other info needed)

`C:\pinokio\api\yue.git\app\inference>conda_hook && conda deactivate && conda deactivate && conda deactivate && conda activate base && C:\pinokio\api\yue.git\app\env\Scripts\activate C:\pinokio\api\yue.git\app\env && python gradio_server.py --profile 5

You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with model.to('cuda').
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 5.31it/s]
C:\pinokio\api\yue.git\app\env\Lib\site-packages\torch\nn\utils\weight_norm.py:143: FutureWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
WeightNorm.apply(module, name, dim)
C:\pinokio\api\yue.git\app\inference\gradio_server.py:135: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
parameter_dict = torch.load(args.resume_path, map_location='cpu')
************ Memory Management for the GPU Poor (mmgp 3.1.4-15) by DeepBeepMeep ************
You have chosen the slowest profile that requires at least 24 GB of RAM and 10 GB of VRAM.
Quantization of model 'transformer' started to format 'quanto.qint8'
Quantization of model 'transformer' done
Pinning data of 'transformer' to reserved RAM
The whole model was pinned to reserved RAM: 26 large blocks spread across 6266.83 MB
Hooked to model 'transformer' (LlamaForCausalLM)
Pinning data of 'stage2' to reserved RAM
The whole model was pinned to reserved RAM: 16 large blocks spread across 3743.25 MB
Hooked to model 'stage2' (LlamaForCausalLM)

  • Running on local URL: http://localhost:7860
  • To create a public link, set share=True in launch().
    0it [00:00, ?it/s]
    Traceback (most recent call last):
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\queueing.py", line 626, in process_events
    response = await route_utils.call_process_api(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\route_utils.py", line 350, in call_process_api
    output = await app.get_blocks().process_api(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\blocks.py", line 2239, in process_api
    result = await self.call_function(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\blocks.py", line 1758, in call_function
    prediction = await utils.async_iteration(iterator)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\utils.py", line 762, in async_iteration
    return await anext(iterator)
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\utils.py", line 753, in anext
    return await anyio.to_thread.run_sync(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\anyio_backends_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
    ^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\anyio_backends_asyncio.py", line 967, in run
    result = context.run(func, *args)
    ^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\utils.py", line 736, in run_sync_iterator_async
    return next(iterator)
    ^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\env\Lib\site-packages\gradio\utils.py", line 900, in gen_wrapper
    response = next(iterator)
    ^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\inference\gradio_server.py", line 587, in generate_song
    stage1_output_set = stage1_inference(genres, lyrics_input, run_n_segments, max_new_tokens, seed, state, callback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\pinokio\api\yue.git\app\inference\gradio_server.py", line 286, in stage1_inference
    if raw_output is None:
    ^^^^^^^^^^
    UnboundLocalError: cannot access local variable 'raw_output' where it is not associated with a value`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions