kaba 0.1.0 → 0.2.0

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: 7d0d15c1454667339192ecb68a40a0128221f0e2f176c9668fdddbaf6507a143
4
- data.tar.gz: 63d4b6088c24453874a2acf9a1c183b6d7468a0297c43cf32feccd0e838f84c0
3
+ metadata.gz: 3add323686f57e3e0552468bcbe17287aadbeffaa2454378bb9ee334dd0a142b
4
+ data.tar.gz: 5aa4f3d631a0f547b9ab0745e27c1d12b1877eb413b2a05642634f94fb7dea1d
5
5
  SHA512:
6
- metadata.gz: 0e937f2aea17053fd01b8a4b5f76f61d58d2817eed4e12942f4edaee0ef72b8cf2fc2c3febeb082d49131fad6aba495bfc7385d59bd13c127b8faaa0ad1a7719
7
- data.tar.gz: 592a977e7ec2c0b80f76e9f4c9fa0875357466ab1e6cbb05e9dec0fdabe086d8f25fda39caad60d0334ed145a69483ef6ea091d25bc5c39299c9afc5380d6155
6
+ metadata.gz: 2be265488852253a51cd68f4268db8c7e774460e32f0802ebf4deae1bdb00557a324dd5bb80f57738d9a24ed56b7d92acba6905b8aad60eac1c87cd2d4410cc1
7
+ data.tar.gz: 8df40bd780cc37ed567cbc7fb93374c4e81d6ded7e805bddae9e1667b3cfe34ddb155ebd41c9865f8146959a17d1bb14e0f48de6d207f6a95aa47d3c930ac8f9
data/.dockerignore ADDED
@@ -0,0 +1,2 @@
1
+ DPodfile
2
+ /data
data/Dockerfile ADDED
@@ -0,0 +1,33 @@
1
+ FROM ruby:3.3-alpine
2
+
3
+ # Set the working directory to /kaba
4
+ WORKDIR /kaba
5
+
6
+ # Copy the Gemfile, Gemfile.lock into the container
7
+ COPY Gemfile Gemfile.lock kaba.gemspec ./
8
+
9
+ # Required in kaba.gemspec
10
+ COPY lib/kaba/version.rb /kaba/lib/kaba/version.rb
11
+ COPY Gemfile /kaba/Gemfile
12
+ COPY Gemfile.lock /kaba/Gemfile.lock
13
+
14
+ # Install application dependencies
15
+ RUN apk add --no-cache build-base git && bundle install
16
+
17
+ # Copy the rest of our application code into the container.
18
+ # We do this after bundle install, to avoid having to run bundle
19
+ # every time we do small fixes in the source code.
20
+ COPY . .
21
+
22
+ # Install the gem locally from the project folder
23
+ RUN gem build kaba.gemspec && \
24
+ gem install ./kaba-*.gem --no-document
25
+
26
+ RUN rm -rf /kaba
27
+
28
+ # Set the working directory to /workdir
29
+ WORKDIR /workdir
30
+
31
+ # Set the entrypoint to run the installed binary in /workdir
32
+ # Example: docker run -it -v "$PWD:/workdir" kaba
33
+ ENTRYPOINT ["kaba"]
data/README.md CHANGED
@@ -1,9 +1,27 @@
1
1
  # Kaba
2
+ 咔吧是一款数据构建工具,使用 Ruby 完成,使用 typechat 作为核心,目的是构建一款能够比较好适配大模型 sft 数据集的工具,整个项目使用起来只需要安装 docker 即可。
3
+
4
+ > 开源协议:你爱干嘛干嘛
5
+
6
+ ## 安装
7
+
8
+ 如果你有一个 Ruby 环境可用(且 ruby 版本大于 3.3),你可以使用以下命令全局安装 kaba:
9
+ ```
10
+ gem install kaba
11
+ ```
12
+
13
+ 否则,你可以通过别名运行一个 docker 化版本(将下面的命令添加到你的~/.bashrc、~/.zshrc或类似文件中,以简化重复使用)。
14
+
15
+ ```
16
+ alias kaba='docker run -it --rm -v "${PWD}:/workdir" ghcr.io/mjason/kaba:latest'
17
+ ```
18
+
19
+ ## 目录结构说明
2
20
 
3
21
  ## 目录结构
4
22
  - data
5
23
  - row
6
24
  - schema
7
25
 
8
- ## 命令
9
- `gem install kaba`
26
+ ## 项目依赖
27
+
data/exe/kaba CHANGED
@@ -10,10 +10,14 @@ require 'async/http/faraday'
10
10
  require 'json'
11
11
  require "kaba"
12
12
 
13
+ require 'dotenv'
14
+ Dotenv.load
15
+
13
16
  class Application
14
17
  class << self
15
18
  def connection
16
- @connection ||= Faraday.new('https://lisa-typechat.listenai.com') do |faraday|
19
+ endpoint = ENV["LISA_TYPECHAT_ENDPOINT"] || "No endpoint"
20
+ @connection ||= Faraday.new(endpoint) do |faraday|
17
21
  faraday.adapter :async_http, clients: Async::HTTP::Faraday::PersistentClients
18
22
  faraday.request :json
19
23
  end
data/kaba.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "async-http-faraday", "~> 0.19.0"
37
37
  spec.add_dependency "colorize", "~> 1.1"
38
38
  spec.add_dependency "tty-progressbar", "~> 0.18.3"
39
+ spec.add_dependency "dotenv", "~> 3.1"
39
40
 
40
41
  # For more information and examples about making a new gem, check out our
41
42
  # guide at: https://bundler.io/guides/creating_gem.html
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.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MJ
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.18.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: dotenv
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.1'
83
97
  description: 用来做数据集的工具
84
98
  email:
85
99
  - tywf91@gmail.com
@@ -88,6 +102,8 @@ executables:
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
105
+ - ".dockerignore"
106
+ - Dockerfile
91
107
  - README.md
92
108
  - Rakefile
93
109
  - exe/kaba