-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add safetensor metadata parsing and display #1074
base: main
Are you sure you want to change the base?
Conversation
Genteure
commented
Dec 30, 2024
Thank you for the submission! Love the idea for sure, just had a couple issues running it locally -
Also, the regular ItemsControl & FlexPanel do not support virtualization by default, leading to a delay before opening the dialog while it renders all the tags. In some cases, my models have over 2500 tags, so it took a few seconds. I replaced the ItemsControl with an ItemsRepeater & FlowLayout from FluentAvalonia and it performs much better. For example: <ui:ItemsRepeater
Grid.Row="3"
Margin="8"
IsVisible="{Binding Metadata.TagFrequency, Converter={x:Static ObjectConverters.IsNotNull}}"
ItemsSource="{Binding Metadata.TagFrequency}">
<ui:ItemsRepeater.ItemTemplate>
<DataTemplate x:CompileBindings="False">
<Button
Cursor="Hand">
<StackPanel Orientation="Horizontal">
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
<TextBlock Margin="5,0,0,0" Text="{Binding Frequency}" />
</StackPanel>
</Button>
</DataTemplate>
</ui:ItemsRepeater.ItemTemplate>
<ui:ItemsRepeater.Layout>
<ui:FlowLayout MinRowSpacing="4" MinColumnSpacing="4" Orientation="Horizontal"/>
</ui:ItemsRepeater.Layout>
</ui:ItemsRepeater> Also if you would prefer to not use |
Right, now I think I really should've opened an issue discussing how to implement this UI wise before actually doing it.
I have tried saving the parsed metadata into litedb but the database read/write performance is way way worse (15-20 times slower). Not sure what exactly is causing this, maybe it's just the amount of data is a lot larger?
I totally forgot that's a thing, will test and use that instead.
I went from |
Hi, first of all thanks for the PR. I've looked over the
I believe it's a performance issue with the litedb async interface we're using, the IO delay is quite long for read and writes. We could cache the safetensors metadata in the (I'm leaning towards removing any litedb operations for model indexing at some point and just loading to memory on startup, since at least on my end the full indexing combined with cm-info reading is consistently faster than reading from litedb.)
We could probably not load the safetensor data with indexing as well. We could have another "View Safetensor Metadata" could first check |