Download Sources/PromptGarageCore/Models/PromptStatistics.swift from smlflg/PromtGarageMac: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Models/PromptStatistics.swift
- Command line
-
hf download hf://smlflg/PromtGarageMac/Sources/PromptGarageCore/Models/PromptStatistics.swift
-
curl -L -o PromptStatistics.swift https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Models/PromptStatistics.swift
1.32 kB
| import Foundation | |
| public struct CountedValue: Identifiable, Hashable, Sendable { | |
| public var id: String { name } | |
| public let name: String | |
| public let count: Int | |
| public init(name: String, count: Int) { | |
| self.name = name | |
| self.count = count | |
| } | |
| } | |
| public struct PromptStatistics: Sendable { | |
| public let total: Int | |
| public let starred: Int | |
| public let totalUses: Int | |
| public let sourceFamilies: [CountedValue] | |
| public let models: [CountedValue] | |
| public let tags: [CountedValue] | |
| public let ratingDistribution: [Int: Int] | |
| public init( | |
| total: Int, | |
| starred: Int, | |
| totalUses: Int, | |
| sourceFamilies: [CountedValue], | |
| models: [CountedValue], | |
| tags: [CountedValue], | |
| ratingDistribution: [Int: Int] | |
| ) { | |
| self.total = total | |
| self.starred = starred | |
| self.totalUses = totalUses | |
| self.sourceFamilies = sourceFamilies | |
| self.models = models | |
| self.tags = tags | |
| self.ratingDistribution = ratingDistribution | |
| } | |
| public static let empty = PromptStatistics( | |
| total: 0, | |
| starred: 0, | |
| totalUses: 0, | |
| sourceFamilies: [], | |
| models: [], | |
| tags: [], | |
| ratingDistribution: Dictionary(uniqueKeysWithValues: (0...5).map { ($0, 0) }) | |
| ) | |
| } | |