Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
￴￴ committed Jul 8, 2024
1 parent 489f817 commit e6251e0
Show file tree
Hide file tree
Showing 60 changed files with 97 additions and 2,579 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
# [submodule "native_lib/whisper.cpp"]
# path = native_lib/whisper.cpp
# url = https://github.com/ggerganov/whisper.cpp.git
[submodule "native_lib/whisper.cpp"]
path = native_lib/whisper.cpp
url = https://github.com/ggerganov/whisper.cpp.git
1 change: 0 additions & 1 deletion native_lib/whisper.cpp
Submodule whisper.cpp deleted from b0c3cb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba
<!-- END LICENSE --> */
import 'package:general_lib/json_to_script_dart/json_to_script.dart';
import 'package:path/path.dart';
import 'package:whisper_scheme/schemes/api_schemes.dart';
import 'package:whisper/schemes/api_schemes.dart';
import 'dart:io';

import 'package:whisper_scheme/schemes/respond_schemes.dart';
import 'package:whisper/schemes/respond_schemes.dart';

void main(List<String> args) async {
Directory directory_scheme = Directory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@
import "package:general_lib/general_lib.dart";
// import "dart:convert";



class GetTextFromWavFile extends JsonScheme {
GetTextFromWavFile(super.rawData);


GetTextFromWavFile(super.rawData);

static Map get defaultData {
return {
"@type": "getTextFromWavFile",
"is_translate": false,
"threads": 12,
"is_verbose": false,
"language": "id",
"is_special_tokens": false,
"is_no_timestamps": false,
"audio": "./audio.wav",
"model": "./model.bin",
};
return {"@type":"getTextFromWavFile","is_translate":false,"threads":12,"is_verbose":false,"language":"id","is_special_tokens":false,"is_no_timestamps":false,"audio":"./audio.wav","model":"./model.bin"};
}


String? get special_type {
try {
if (rawData["@type"] is String == false) {
if (rawData["@type"] is String == false){
return null;
}
return rawData["@type"] as String;
Expand All @@ -30,13 +25,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set special_type(String? value) {
rawData["@type"] = value;
}



bool? get is_translate {
try {
if (rawData["is_translate"] is bool == false) {
if (rawData["is_translate"] is bool == false){
return null;
}
return rawData["is_translate"] as bool;
Expand All @@ -45,13 +43,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set is_translate(bool? value) {
rawData["is_translate"] = value;
}



num? get threads {
try {
if (rawData["threads"] is num == false) {
if (rawData["threads"] is num == false){
return null;
}
return rawData["threads"] as num;
Expand All @@ -60,13 +61,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set threads(num? value) {
rawData["threads"] = value;
}



bool? get is_verbose {
try {
if (rawData["is_verbose"] is bool == false) {
if (rawData["is_verbose"] is bool == false){
return null;
}
return rawData["is_verbose"] as bool;
Expand All @@ -75,13 +79,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set is_verbose(bool? value) {
rawData["is_verbose"] = value;
}



String? get language {
try {
if (rawData["language"] is String == false) {
if (rawData["language"] is String == false){
return null;
}
return rawData["language"] as String;
Expand All @@ -90,13 +97,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set language(String? value) {
rawData["language"] = value;
}



bool? get is_special_tokens {
try {
if (rawData["is_special_tokens"] is bool == false) {
if (rawData["is_special_tokens"] is bool == false){
return null;
}
return rawData["is_special_tokens"] as bool;
Expand All @@ -105,13 +115,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set is_special_tokens(bool? value) {
rawData["is_special_tokens"] = value;
}



bool? get is_no_timestamps {
try {
if (rawData["is_no_timestamps"] is bool == false) {
if (rawData["is_no_timestamps"] is bool == false){
return null;
}
return rawData["is_no_timestamps"] as bool;
Expand All @@ -120,13 +133,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set is_no_timestamps(bool? value) {
rawData["is_no_timestamps"] = value;
}



String? get audio {
try {
if (rawData["audio"] is String == false) {
if (rawData["audio"] is String == false){
return null;
}
return rawData["audio"] as String;
Expand All @@ -135,13 +151,16 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set audio(String? value) {
rawData["audio"] = value;
}



String? get model {
try {
if (rawData["model"] is String == false) {
if (rawData["model"] is String == false){
return null;
}
return rawData["model"] as String;
Expand All @@ -150,11 +169,15 @@ class GetTextFromWavFile extends JsonScheme {
}
}


set model(String? value) {
rawData["model"] = value;
}



static GetTextFromWavFile create({

String special_type = "getTextFromWavFile",
bool? is_translate,
num? threads,
Expand All @@ -164,9 +187,10 @@ class GetTextFromWavFile extends JsonScheme {
bool? is_no_timestamps,
String? audio,
String? model,
}) {
}) {
// GetTextFromWavFile getTextFromWavFile = GetTextFromWavFile({
Map getTextFromWavFile_data_create_json = {
Map getTextFromWavFile_data_create_json = {

"@type": special_type,
"is_translate": is_translate,
"threads": threads,
Expand All @@ -176,11 +200,17 @@ class GetTextFromWavFile extends JsonScheme {
"is_no_timestamps": is_no_timestamps,
"audio": audio,
"model": model,
};

getTextFromWavFile_data_create_json.removeWhere((key, value) => value == null);
GetTextFromWavFile getTextFromWavFile_data_create = GetTextFromWavFile(getTextFromWavFile_data_create_json);

return getTextFromWavFile_data_create;
}
}
};


getTextFromWavFile_data_create_json.removeWhere((key, value) => value == null);
GetTextFromWavFile getTextFromWavFile_data_create = GetTextFromWavFile(getTextFromWavFile_data_create_json);

return getTextFromWavFile_data_create;



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ List<Map> api_schemes = [
{
"@type":"getVersion",
}
];
];
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ List<Map> respond_schemes = [
"@type": "version",
"message": "",
},
];
];
4 changes: 2 additions & 2 deletions package/whisper/lib/whisper_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba
// ignore_for_file: non_constant_identifier_names, unnecessary_string_interpolations

import 'package:general_lib/general_lib.dart';
import 'package:whisper_scheme/scheme/api_scheme/get_text_from_wav_file.dart';
import 'package:whisper/scheme/api_scheme/get_text_from_wav_file.dart';
// import 'package:universal_io/io.dart';
import 'package:whisper_scheme/scheme/respond_scheme/respond_scheme.dart';
import 'package:whisper/scheme/respond_scheme/respond_scheme.dart';

class Whisper {
String whisper_lib = "libwhisper.${getFormatLibrary}";
Expand Down
6 changes: 2 additions & 4 deletions package/whisper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ environment:
dependencies:
ffi: '^2.0.1'
ffmpeg_dart: '^0.0.0'
general_lib: ^0.0.34
general_lib: ^0.0.42
universal_io: '^2.2.0'
whisper_scheme:
path: ../whisper_scheme


dev_dependencies:
lints: '^2.0.0'
test: '^1.16.0'
6 changes: 3 additions & 3 deletions package/whisper/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependency_overrides:
whisper_scheme:
path: ../whisper_scheme
# dependency_overrides:
# whisper_scheme:
# path: ../whisper_scheme

30 changes: 0 additions & 30 deletions package/whisper_dart/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions package/whisper_dart/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions package/whisper_dart/LICENSE

This file was deleted.

Loading

0 comments on commit e6251e0

Please sign in to comment.