Browse Source

Merge pull request #608 from ionite34/stuff-n-junk

fix comment parsing & metadata parsing
pull/629/head
JT 7 months ago committed by GitHub
parent
commit
153f89ed87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 2
      StabilityMatrix.Core/Python/PipInstallArgs.cs
  3. 10
      StabilityMatrix.Core/Services/MetadataImportService.cs

5
CHANGELOG.md

@ -5,6 +5,11 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
## v2.something
### Fixed
- Fixed more crashes when loading invalid connected model info files
- Fixed pip installs not parsing comments properly
## v2.10.1 ## v2.10.1
### Added ### Added
- Added SVD Shared Model & Output Folders for Forge (fixes [#580](https://github.com/LykosAI/StabilityMatrix/issues/580)) - Added SVD Shared Model & Output Folders for Forge (fixes [#580](https://github.com/LykosAI/StabilityMatrix/issues/580))

2
StabilityMatrix.Core/Python/PipInstallArgs.cs

@ -30,7 +30,7 @@ public record PipInstallArgs : ProcessArgsBuilder
{ {
var requirementsEntries = requirements var requirementsEntries = requirements
.SplitLines(StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) .SplitLines(StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries)
.AsEnumerable(); .Where(s => !s.StartsWith('#'));
if (excludePattern is not null) if (excludePattern is not null)
{ {

10
StabilityMatrix.Core/Services/MetadataImportService.cs

@ -155,9 +155,17 @@ public class MetadataImportService(
var cmInfoList = new Dictionary<FilePath, ConnectedModelInfo>(); var cmInfoList = new Dictionary<FilePath, ConnectedModelInfo>();
foreach (var cmInfoPath in directory.EnumerateFiles("*.cm-info.json", SearchOption.AllDirectories)) foreach (var cmInfoPath in directory.EnumerateFiles("*.cm-info.json", SearchOption.AllDirectories))
{ {
var cmInfo = JsonSerializer.Deserialize<ConnectedModelInfo>( ConnectedModelInfo? cmInfo;
try
{
cmInfo = JsonSerializer.Deserialize<ConnectedModelInfo>(
await cmInfoPath.ReadAllTextAsync().ConfigureAwait(false) await cmInfoPath.ReadAllTextAsync().ConfigureAwait(false)
); );
}
catch (JsonException)
{
cmInfo = null;
}
if (cmInfo == null) if (cmInfo == null)
continue; continue;

Loading…
Cancel
Save