kaba 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87911927cc961d9cde4f12b9ec86da34b1e13b00fa0c984a69c758ff06bdf67f
4
- data.tar.gz: 8da74f6aeb020d0438e33f69387c975643ec72739d029a193370b7d3d9878e03
3
+ metadata.gz: '0819a2ca5b94fd6ce32a48fc973dd86d0c2234a073bf32ee9327e02f572b45b2'
4
+ data.tar.gz: 203c7c8cfcc4d1d059c01b01467f8b897580c4422d25db85335a2b119e674401
5
5
  SHA512:
6
- metadata.gz: 5271d2d31f23d185ecfe7b3d0fc47b7f200a1d659d6e1ca8939a9216e5ead2449dc1abdddb622c3d972fb3b5b668cc481e0626425454bbfd03807e8432f51aec
7
- data.tar.gz: 4ba6e7b05b0fffc61f6462188809d63bb7a700876b4084e82ecce1096c8b5c5ab15fef7b82c33884513cc2f999986855f3f779c1bb3d3acc9b1c90ef79536e62
6
+ metadata.gz: 8abc31a51664418d2c8df17d2ff370c71b3124df3eb4cd17b9f05d3162e75b7fe76945986e47ae6415d0d43147be83c9627a41e9b9f7181623dcb752e91a0873
7
+ data.tar.gz: cc4078a6d7b4205d4403a4451ec95d4020c354809332788c755f0d2a2f6381f3d36d5206f96f7b04312a7ddf72348c2fadcf8ee519e63be4bcd730a76761b3bd
data/exe/kaba CHANGED
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "bundler/setup"
3
3
 
4
- require 'async'
5
- require 'faraday'
6
- require 'colorize'
7
- require 'tty-progressbar'
8
- require 'async/http/faraday'
9
-
10
4
  require 'json'
11
5
  require "kaba"
12
6
 
data/lib/kaba/_DPodfile_ CHANGED
@@ -24,6 +24,8 @@ validate.run_files(source.row)
24
24
  dataset.scan()
25
25
  dataset.save(source.join('train.jsonl'))
26
26
 
27
+ puts "Dataset 校验结果:#{dataset.validate}"
28
+
27
29
  ## 高级玩法,不要轻易尝试
28
30
  #
29
31
  ### 可以加入 limit 来限制读取的文件数量,validate.run_files('./data/row', limit: 1) do |response, json, file|
data/lib/kaba/validate.rb CHANGED
@@ -18,7 +18,7 @@ class Validate
18
18
  # 读取某个文件然后运行
19
19
  def run_file(file)
20
20
  input = JSON.parse File.read(File.expand_path file)
21
- ValidateReponse.new run(input)
21
+ ValidateReponse.new run(input), file: file
22
22
  end
23
23
 
24
24
  # 读取某个文件夹下的然后运行,运行有结果了 block 会被调用
@@ -75,8 +75,8 @@ class Validate
75
75
 
76
76
  def to_s
77
77
  s = "#{'success:'.colorize(:bold_blue)} #{success? ? 'true'.colorize(:green) : 'false'.colorize(:red)}"
78
- s += "\n#{'file:'.colorize(:bold_blue)} #{file.colorize(:yellow)}"
79
- s += "\n#{'message:'.colorize(:bold_blue)} #{message.colorize(:yellow)}" unless success?
78
+ s += "\n#{'file:'.colorize(:bold_blue)} #{file&.to_s&.colorize(:yellow)}"
79
+ s += "\n#{'message:'.colorize(:bold_blue)} #{message&.colorize(:yellow)}" unless success?
80
80
  s += "\n\n"
81
81
  end
82
82
  end
data/lib/kaba/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kaba
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
data/lib/kaba.rb CHANGED
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'async'
4
+ require 'faraday'
5
+ require 'colorize'
6
+ require 'tty-progressbar'
7
+ require 'async/http/faraday'
8
+
3
9
  require_relative "kaba/version"
4
10
  require_relative "kaba/dataset"
5
11
  require_relative "kaba/dataset_source"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MJ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-13 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async