easy_ml 0.2.0.pre.rc26 → 0.2.0.pre.rc28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/easy_ml/predictions_controller.rb +18 -0
- data/app/jobs/easy_ml/clean_job.rb +9 -0
- data/config/initializers/zhong.rb +17 -0
- data/config/routes.rb +7 -0
- data/lib/easy_ml/engine.rb +1 -1
- data/lib/easy_ml/version.rb +1 -1
- data/lib/tasks/zhong.rake +6 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 759592a8ae36ec3898d0acf83ff58ef0b0da9fd3cc3cfc492ac151cf8cc22360
|
4
|
+
data.tar.gz: d24de00abea52b9fe4d2d911075924134f66315d2e6a8fb9d0b28cbbbd7236ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9743d17f8f429e86d7b5635f8dc72179fcd928f0a1cf394bc2b8ff750e7349a8383f4bd58e2d1e5b4ef96da670578034493c28fdd863b88a0022cddc87013eb
|
7
|
+
data.tar.gz: 22e5a0ebe5aaa8a53e8927b8caae83c5badfe1deea04885db5f2081ad0e30bfe3166279d0208b8b7363cfecf95a572afb3132a94217beda99bab9a1781090a68
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module EasyML
|
2
|
+
class PredictionsController < ApplicationController
|
3
|
+
skip_before_action :verify_authenticity_token, only: [:create]
|
4
|
+
|
5
|
+
def create
|
6
|
+
model_name = params[:model]
|
7
|
+
input = params[:input]
|
8
|
+
|
9
|
+
predictions = EasyML::Predict.predict(model_name, input)
|
10
|
+
|
11
|
+
render json: { prediction: predictions.first }
|
12
|
+
rescue ActiveRecord::RecordNotFound
|
13
|
+
render json: { error: "Model not found" }, status: :not_found
|
14
|
+
rescue StandardError => e
|
15
|
+
render json: { error: e.message }, status: :unprocessable_entity
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "zhong"
|
2
|
+
|
3
|
+
Zhong.setup do |config|
|
4
|
+
config.logger = Rails.logger
|
5
|
+
config.time_zone = "UTC"
|
6
|
+
|
7
|
+
# Use Redis to persist the scheduler state
|
8
|
+
config.redis = Redis.new(
|
9
|
+
url: ENV.fetch("REDIS_URL") { "redis://localhost:6379/0" },
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
Zhong.schedule do
|
14
|
+
every 1.hour, "cleanup" do
|
15
|
+
CleanJob.perform_later
|
16
|
+
end
|
17
|
+
end
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
EasyML::Engine.routes.draw do
|
2
2
|
root to: "models#index"
|
3
3
|
get "healthcheck", to: "health#up"
|
4
|
+
|
5
|
+
mount Zhong::Web, at: "/zhong"
|
6
|
+
mount Resque::Server.new, at: "/resque"
|
7
|
+
|
8
|
+
# Predictions API
|
9
|
+
resources :predictions, only: [:create]
|
10
|
+
|
4
11
|
resources :models, as: :easy_ml_models do
|
5
12
|
member do
|
6
13
|
post :train
|
data/lib/easy_ml/engine.rb
CHANGED
@@ -49,7 +49,7 @@ module EasyML
|
|
49
49
|
Polars.enable_string_cache
|
50
50
|
end
|
51
51
|
|
52
|
-
if %w[db:migrate db:migrate:status db:setup db:drop].include?(ARGV.first)
|
52
|
+
if %w[db:migrate db:migrate:status db:setup db:drop assets:precompile].include?(ARGV.first)
|
53
53
|
config.eager_load_paths = config.eager_load_paths.without(config.eager_load_paths.map(&:to_s).grep(/easy_ml/).map { |p| Pathname.new(p) })
|
54
54
|
else
|
55
55
|
config.after_initialize do
|
data/lib/easy_ml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_ml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.pre.
|
4
|
+
version: 0.2.0.pre.rc28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Shollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -447,6 +447,7 @@ files:
|
|
447
447
|
- app/controllers/easy_ml/deploys_controller.rb
|
448
448
|
- app/controllers/easy_ml/health_controller.rb
|
449
449
|
- app/controllers/easy_ml/models_controller.rb
|
450
|
+
- app/controllers/easy_ml/predictions_controller.rb
|
450
451
|
- app/controllers/easy_ml/retraining_runs_controller.rb
|
451
452
|
- app/controllers/easy_ml/settings_controller.rb
|
452
453
|
- app/easy_ml/.vite/manifest-assets.json
|
@@ -520,6 +521,7 @@ files:
|
|
520
521
|
- app/helpers/easy_ml/application_helper.rb
|
521
522
|
- app/jobs/easy_ml/application_job.rb
|
522
523
|
- app/jobs/easy_ml/batch_job.rb
|
524
|
+
- app/jobs/easy_ml/clean_job.rb
|
523
525
|
- app/jobs/easy_ml/compute_feature_job.rb
|
524
526
|
- app/jobs/easy_ml/deploy_job.rb
|
525
527
|
- app/jobs/easy_ml/finalize_feature_job.rb
|
@@ -590,6 +592,7 @@ files:
|
|
590
592
|
- bin/vite
|
591
593
|
- config/initializers/inflections.rb
|
592
594
|
- config/initializers/resque.rb
|
595
|
+
- config/initializers/zhong.rb
|
593
596
|
- config/resque-pool.yml
|
594
597
|
- config/routes.rb
|
595
598
|
- config/spring.rb
|
@@ -662,6 +665,7 @@ files:
|
|
662
665
|
- lib/easy_ml/version.rb
|
663
666
|
- lib/tasks/resque.rake
|
664
667
|
- lib/tasks/vite.rake
|
668
|
+
- lib/tasks/zhong.rake
|
665
669
|
- public/easy_ml/assets/.vite/manifest-assets.json
|
666
670
|
- public/easy_ml/assets/.vite/manifest.json
|
667
671
|
- public/easy_ml/assets/assets/Application-Cu7lNJmG.css
|