Skip to content

Merging Lora with Model - "Ratios" - TypeError: sequence item 12: expected str instance, float found #23

@cosmiclantern

Description

@cosmiclantern

I'm trying to merge a Lora into a checkpoint (safetensors), and it won't let me. I think it has something to do with the value in the "Ratios" field. What is the required format for this field?
When I put any integer or float value in the "ratios" field, such as "0.7" (without quotation marks), it gives me this:

Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/gradio/routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1015, in process_api
result = await self.call_function(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 833, in call_function
prediction = await anyio.to_thread.run_sync(
File "/opt/conda/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/content/kohya-sd-scripts-webui/scripts/runner.py", line 38, in run
proc = run_python(script_file, get_templates(), get_options(), args)
File "/content/kohya-sd-scripts-webui/scripts/utilities.py", line 277, in run_python
print("Start process: ", " ".join(proc_args))
TypeError: sequence item 12: expected str instance, float found


If I leave the "ratios" field blank, it gives me this:

Traceback (most recent call last):
File "/content/kohya-sd-scripts-webui/kohya_ss/networks/merge_lora.py", line 243, in
merge(args)
File "/content/kohya-sd-scripts-webui/kohya_ss/networks/merge_lora.py", line 173, in merge
assert len(args.models) == len(args.ratios), f"number of models must be equal to number of ratios / モデルの数と重みの数は合わせてください"
TypeError: object of type 'NoneType' has no len()


Where are these typeerrors? What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions