Skip to content

Download doesn't check to see if the file actually exists #407

@Draco18s

Description

@Draco18s

Describe the bug

If the model entry cache (serialized) is out of date, then this section...

        public static async Task<string> Download(string url, bool lora = false, bool log = false, string label = null)
        {
            foreach (ModelEntry entry in modelEntries)
            {
                if (entry.url == url)
                {
                    if (log) LLMUnitySetup.Log($"Found existing entry for {url}");
                    return entry.filename;
                }
            }

...essentially resolves to:
"If the url requested is the same as the url in our saved config file, return the saved local disk path."

No attempt is made to check that the file is actually present and the code will error out later when it attempts to read the file.

Steps to reproduce

Download a model
Delete it manually from %appdata%
Restart unity
Attempt to download the same model again

LLMUnity version

v3.0.3

Operating System

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions