Skip to content

Commit e85f03a

Browse files
authored
Merge pull request #298 from LykosAI/main
2 parents 24cb710 + 4da9d24 commit e85f03a

File tree

3 files changed

+58
-19
lines changed

3 files changed

+58
-19
lines changed

.github/workflows/release.yml

+27-16
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,16 @@ jobs:
233233
python-version: '3.11'
234234

235235
- name: Install Python Dependencies
236-
run: pip install stability-matrix-tools>=0.2.15
236+
run: pip install stability-matrix-tools>=0.2.18 --upgrade
237237

238238
- name: Publish Auto-Update Release
239-
run: sm-tools updates publish-matrix-v3 -v ${{ github.event.inputs.version }} -y
239+
env:
240+
SM_B2_API_ID: ${{ secrets.SM_B2_API_ID }}
241+
SM_B2_API_KEY: ${{ secrets.SM_B2_API_KEY }}
242+
SM_CF_CACHE_PURGE_TOKEN: ${{ secrets.SM_CF_CACHE_PURGE_TOKEN }}
243+
SM_CF_ZONE_ID: ${{ secrets.SM_CF_ZONE_ID }}
244+
SM_SIGNING_PRIVATE_KEY: ${{ secrets.SM_SIGNING_PRIVATE_KEY }}
245+
run: sm-tools updates publish-matrix-v3 -v $RELEASE_VERSION -y
240246

241247
publish-auto-update-b2:
242248
name: Publish Auto-Update Release (B2)
@@ -251,24 +257,23 @@ jobs:
251257
echo "Using version ${{ github.event.inputs.version }}"
252258
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_ENV
253259
260+
# Downloads all previous artifacts to the current working directory
261+
- name: Download Artifacts
262+
uses: actions/download-artifact@v3
263+
264+
# Zip each build
265+
- name: Zip Artifacts
266+
run: |
267+
cd StabilityMatrix-win-x64 && zip -r ../StabilityMatrix-win-x64.zip ./. && cd $OLDPWD
268+
cd StabilityMatrix-linux-x64 && zip -r ../StabilityMatrix-linux-x64.zip ./. && cd $OLDPWD
269+
254270
- uses: actions/setup-python@v4
255271
with:
256272
python-version: '3.11'
257273

258274
- name: Install Python Dependencies
259-
run: pip install stability-matrix-tools~=0.2.7
260-
261-
- name: Download Changelog
262-
run: >
263-
sm-tools updates download-changelog -v $RELEASE_VERSION -y
264-
--changelog
275+
run: pip install stability-matrix-tools>=0.2.18 --upgrade
265276

266-
# Zip each build
267-
- name: Zip Artifacts
268-
run: |
269-
zip -r StabilityMatrix-win-x64.zip StabilityMatrix-win-x64/*
270-
zip -r StabilityMatrix-linux-x64.zip StabilityMatrix-linux-x64/*
271-
272277
# Check that the zips and CHANGELOG.md are in the current working directory
273278
- name: Check files
274279
run: |
@@ -286,10 +291,16 @@ jobs:
286291
fi
287292
288293
- name: Publish Auto-Update Release
294+
env:
295+
SM_B2_API_ID: ${{ secrets.SM_B2_API_ID }}
296+
SM_B2_API_KEY: ${{ secrets.SM_B2_API_KEY }}
297+
SM_CF_CACHE_PURGE_TOKEN: ${{ secrets.SM_CF_CACHE_PURGE_TOKEN }}
298+
SM_CF_ZONE_ID: ${{ secrets.SM_CF_ZONE_ID }}
299+
SM_SIGNING_PRIVATE_KEY: ${{ secrets.SM_SIGNING_PRIVATE_KEY }}
289300
run: >
290-
sm-tools updates publish-files-v3 -v $RELEASE_VERSION -y
301+
sm-tools updates publish-files-v3 -v ${{ github.event.inputs.version }}
291302
--channel ${{ github.event.inputs.auto-update-release-channel }}
292303
--changelog CHANGELOG.md
293304
--win-x64 StabilityMatrix-win-x64.zip
294305
--linux-x64 StabilityMatrix-linux-x64.zip
295-
--b2-bucket-name ${{ secrets.B2_BUCKET_NAME }}
306+
-y

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.6.6
9+
### Fixed
10+
- Fixed [#297](https://github.com/LykosAI/StabilityMatrix/issues/297) - Model browser LiteAsyncException occuring when fetching entries with unrecognized values from enum name changes
11+
812
## v2.6.5
913
### Fixed
1014
- Fixed error when receiving unknown model format values from the Model Browser

StabilityMatrix.Avalonia/ViewModels/CheckpointBrowserViewModel.cs

+27-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using CommunityToolkit.Mvvm.ComponentModel;
1616
using CommunityToolkit.Mvvm.Input;
1717
using FluentAvalonia.UI.Controls;
18+
using LiteDB;
19+
using LiteDB.Async;
1820
using NLog;
1921
using Refit;
2022
using StabilityMatrix.Avalonia.Services;
@@ -470,9 +472,31 @@ private async Task SearchModels()
470472
}
471473

472474
// See if query is cached
473-
var cachedQuery = await liteDbContext.CivitModelQueryCache
474-
.IncludeAll()
475-
.FindByIdAsync(ObjectHash.GetMd5Guid(modelRequest));
475+
CivitModelQueryCacheEntry? cachedQuery = null;
476+
477+
try
478+
{
479+
cachedQuery = await liteDbContext.CivitModelQueryCache
480+
.IncludeAll()
481+
.FindByIdAsync(ObjectHash.GetMd5Guid(modelRequest));
482+
}
483+
catch (Exception e)
484+
{
485+
// Suppress 'Training_Data' enum not found exceptions
486+
// Caused by enum name change
487+
// Ignore to do a new search to overwrite the cache
488+
if (
489+
!(
490+
e is LiteException or LiteAsyncException
491+
&& e.InnerException is ArgumentException inner
492+
&& inner.Message.Contains("Training_Data")
493+
)
494+
)
495+
{
496+
// Otherwise log error
497+
Logger.Error(e, "Error while querying CivitModelQueryCache");
498+
}
499+
}
476500

477501
// If cached, update model cards
478502
if (cachedQuery is not null)

0 commit comments

Comments
 (0)