Skip to content

Commit ba82f17

Browse files
authored
Merge pull request #4 from furkanksl/fix/models-option
Fix/models option
2 parents c857552 + ccaae31 commit ba82f17

5 files changed

Lines changed: 300 additions & 68 deletions

File tree

FreeWhisper.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@
740740
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
741741
CODE_SIGN_STYLE = Automatic;
742742
COMBINE_HIDPI_IMAGES = YES;
743-
CURRENT_PROJECT_VERSION = 3;
743+
CURRENT_PROJECT_VERSION = 1;
744744
DEAD_CODE_STRIPPING = YES;
745745
DEFINES_MODULE = YES;
746746
DEVELOPMENT_ASSET_PATHS = "\"FreeWhisper/Preview Content\"";
@@ -772,7 +772,7 @@
772772
"$(PROJECT_DIR)",
773773
);
774774
MACOSX_DEPLOYMENT_TARGET = 14.0;
775-
MARKETING_VERSION = 0.0.7;
775+
MARKETING_VERSION = 0.0.8;
776776
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
777777
PRODUCT_BUNDLE_IDENTIFIER = com.furkanksl.FreeWhisper;
778778
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -793,7 +793,7 @@
793793
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
794794
CODE_SIGN_STYLE = Automatic;
795795
COMBINE_HIDPI_IMAGES = YES;
796-
CURRENT_PROJECT_VERSION = 3;
796+
CURRENT_PROJECT_VERSION = 1;
797797
DEAD_CODE_STRIPPING = YES;
798798
DEFINES_MODULE = YES;
799799
DEVELOPMENT_ASSET_PATHS = "\"FreeWhisper/Preview Content\"";
@@ -827,7 +827,7 @@
827827
);
828828
LLVM_LTO = YES;
829829
MACOSX_DEPLOYMENT_TARGET = 14.0;
830-
MARKETING_VERSION = 0.0.7;
830+
MARKETING_VERSION = 0.0.8;
831831
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
832832
PRODUCT_BUNDLE_IDENTIFIER = com.furkanksl.FreeWhisper;
833833
PRODUCT_NAME = "$(TARGET_NAME)";
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import Foundation
2+
3+
struct DownloadableModel: Identifiable {
4+
let id = UUID()
5+
let name: String
6+
var isDownloaded: Bool
7+
let url: URL
8+
let size: Int
9+
var speedRate: Int
10+
var accuracyRate: Int
11+
var downloadProgress: Double = 0.0
12+
13+
var sizeString: String {
14+
let formatter = ByteCountFormatter()
15+
formatter.allowedUnits = [.useMB, .useGB]
16+
formatter.countStyle = .file
17+
formatter.includesUnit = true
18+
formatter.isAdaptive = true
19+
return formatter.string(fromByteCount: Int64(size) * 1000000)
20+
}
21+
22+
init(name: String, isDownloaded: Bool, url: URL, size: Int, speedRate: Int, accuracyRate: Int) {
23+
self.name = name
24+
self.isDownloaded = isDownloaded
25+
self.url = url
26+
self.size = size
27+
self.speedRate = speedRate
28+
self.accuracyRate = accuracyRate
29+
}
30+
}
31+
32+
let availableModels = [
33+
DownloadableModel(
34+
name: "Turbo V3 large",
35+
isDownloaded: false,
36+
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin?download=true")!,
37+
size: 1624,
38+
speedRate: 60,
39+
accuracyRate: 100
40+
),
41+
DownloadableModel(
42+
name: "Turbo V3 medium",
43+
isDownloaded: false,
44+
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q8_0.bin?download=true")!,
45+
size: 874,
46+
speedRate: 70,
47+
accuracyRate: 70
48+
),
49+
DownloadableModel(
50+
name: "Turbo V3 small",
51+
isDownloaded: false,
52+
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q5_0.bin?download=true")!,
53+
size: 574,
54+
speedRate: 100,
55+
accuracyRate: 60
56+
)
57+
]

FreeWhisper/Onboarding/OnboardingView.swift

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import Foundation
99
import SwiftUI
1010

11+
// Import WhisperModels
12+
import Foundation
13+
1114
class OnboardingViewModel: ObservableObject {
1215
@Published var selectedLanguage: String {
1316
didSet {
@@ -455,7 +458,7 @@ struct PermissionsStepView: View {
455458

456459
// Microphone Permission
457460
PermissionRowView(
458-
icon: Aline Wright"mic.fill",
461+
icon: "mic.fill",
459462
title: "Microphone",
460463
description: "For recording audio to transcribe",
461464
isGranted: permissionsManager.isMicrophonePermissionGranted,
@@ -997,64 +1000,6 @@ struct OnboardingSecondaryButtonStyle: ButtonStyle {
9971000
}
9981001
}
9991002

1000-
// MARK: - Existing Models (keeping the same data structure)
1001-
1002-
struct DownloadableModel: Identifiable {
1003-
let id = UUID()
1004-
let name: String
1005-
var isDownloaded: Bool
1006-
let url: URL
1007-
let size: Int
1008-
var speedRate: Int
1009-
var accuracyRate: Int
1010-
var downloadProgress: Double = 0.0
1011-
1012-
var sizeString: String {
1013-
let formatter = ByteCountFormatter()
1014-
formatter.allowedUnits = [.useMB, .useGB]
1015-
formatter.countStyle = .file
1016-
formatter.includesUnit = true
1017-
formatter.isAdaptive = true
1018-
return formatter.string(fromByteCount: Int64(size) * 1000000)
1019-
}
1020-
1021-
init(name: String, isDownloaded: Bool, url: URL, size: Int, speedRate: Int, accuracyRate: Int) {
1022-
self.name = name
1023-
self.isDownloaded = isDownloaded
1024-
self.url = url
1025-
self.size = size
1026-
self.speedRate = speedRate
1027-
self.accuracyRate = accuracyRate
1028-
}
1029-
}
1030-
1031-
let availableModels = [
1032-
DownloadableModel(
1033-
name: "Turbo V3 large",
1034-
isDownloaded: false,
1035-
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin?download=true")!,
1036-
size: 1624,
1037-
speedRate: 60,
1038-
accuracyRate: 100
1039-
),
1040-
DownloadableModel(
1041-
name: "Turbo V3 medium",
1042-
isDownloaded: false,
1043-
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q8_0.bin?download=true")!,
1044-
size: 874,
1045-
speedRate: 70,
1046-
accuracyRate: 70
1047-
),
1048-
DownloadableModel(
1049-
name: "Turbo V3 small",
1050-
isDownloaded: false,
1051-
url: URL(string: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q5_0.bin?download=true")!,
1052-
size: 574,
1053-
speedRate: 100,
1054-
accuracyRate: 60
1055-
)
1056-
]
1057-
10581003
#Preview {
10591004
OnboardingView()
10601005
}

0 commit comments

Comments
 (0)