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

AVLN:0004 Data at the root level is invalid - due to adding a gguf file as asset #16223

Closed
markat1 opened this issue Jul 3, 2024 · 7 comments
Labels

Comments

@markat1
Copy link

markat1 commented Jul 3, 2024

Describe the bug

I'm getting a AVLN:0004 Data at the root level is invalid , when I tried adding a gguf to the csproj

<ItemGroup>
   <AvaloniaResource Include="Assets\avalonia-logo.ico" />
   <AvaloniaResource Include="Assets\qween.gguf" />

 </ItemGroup>

Here's the Asset folder:

image

here's the complete error:

Severity Code Description Project File Line

Severity Code Description Project File Line Suppression State Error (active) AVLN:0004at the root level is invalid. Line 1, position 1. AvalTest.AvaloniaProject C:\Users\test\source\repos\AvalTest.AvaloniaProject\AvalTest.AvaloniaProject\App.axaml 1

image

To Reproduce

  1. Create a new avalonia project
  2. add a gguf file to the Asset folder. (gguf is 4 GB in size)
  3. include following code in the csproj
  <ItemGroup>
    <AvaloniaResource Include="Assets\avalonia-logo.ico" />
    <AvaloniaResource Include="Assets\qween.gguf" />
  </ItemGroup>

or just leave standard setup like this and run a build.

 <ItemGroup>
   <AvaloniaResource Include="Assets\**" />
 </ItemGroup>

Expected behavior

Expected behaivor is that it can run the application without creating any errors like AVLN:0004

Avalonia version

11.0.11

OS

Windows 11

Additional context

Avolonia desktop application

@markat1 markat1 added the bug label Jul 3, 2024
@maxkatz6
Copy link
Member

maxkatz6 commented Jul 3, 2024

We probably should add a max size limit for avalonia resources and output a better error instead.

add a gguf file to the Asset folder. (gguf is 4 GB in size)

Are you sure you want to embed 4 GB file into an executable? That's what avalonia resources are.
You still can use it as a <Content /> entry copied to the output folder, and use FileIO apis to read it.

@markat1
Copy link
Author

markat1 commented Jul 4, 2024

Hello @maxkatz6 - thank you so much for your fast reply!

Hmm as long as I can read the file via FileIO, then that's the way to go.

But should I copy gguf into bin/debug and bin/release via csproj?

where should I put gguf?

use API ?

I could add gguf-file to a API, but then I have to figure out wether it's possible to integerate API as part of avalonia UI? I know it's not optimal to integrate API with the application, but what else can I make it easy to publish application without the complications of setting up ekstern server?

@timunie
Copy link
Contributor

timunie commented Jul 4, 2024

What is that even this gguf-file and why is it as big as an entire DVD film?

@markat1
Copy link
Author

markat1 commented Jul 4, 2024

It's LLM inference file - this is actually small believe it or not ;)

@timunie
Copy link
Contributor

timunie commented Jul 5, 2024

Ah okay, so I'd rather provide such a file independent from the exenin order to allow an easier update of it if needed. Anyways, don't ship as an asset due to file size and startup performance. Use disc IO for fhe acccess to it.

@markat1
Copy link
Author

markat1 commented Jul 5, 2024

thank you for your reply @timunie

okay, so I should copy gguf-file directly over to bin/debug and bin/Release ?

@timunie
Copy link
Contributor

timunie commented Jul 5, 2024

You can ask dotnet to copy a file to output dir, see: https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2022#compile

@markat1 markat1 closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants