bitfab 0.62.0 → 0.62.2
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/lib/bitfab/graders.rb +15 -1
- data/lib/bitfab/replay_registry.rb +3 -1
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9c9645b803f604245b2f2f2bbd14117590321d81234a8f423c1cd28a3e44a87
|
|
4
|
+
data.tar.gz: a2171ba8262decea1b34c57bcb67cb4d678aab2b10fa42f9f3ba7ca889c2a5b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de9ac521536899df9364387a8ad984328b952463bf79a440156156d8478aaf58331d9b4feec5f08b56f9bda8518eb6833a654301a3b9d9600dfd7fd6d20ffb49
|
|
7
|
+
data.tar.gz: 928e7013f798a18e730225d97e13ea2a6752d5e76c0a880b5df860fdfa7b016d8f44382026b926b0759c656c10b634d28abba5c4d8bc448aa3f3b85a26d539a4
|
data/lib/bitfab/graders.rb
CHANGED
|
@@ -4,6 +4,8 @@ require "uri"
|
|
|
4
4
|
|
|
5
5
|
module Bitfab
|
|
6
6
|
class Graders
|
|
7
|
+
GRADER_LABELS_PATH = "/api/sdk/graderLabels"
|
|
8
|
+
|
|
7
9
|
def initialize(http_client)
|
|
8
10
|
@http_client = http_client
|
|
9
11
|
end
|
|
@@ -17,7 +19,19 @@ module Bitfab
|
|
|
17
19
|
params["traceIds"] = trace_ids.join(",") unless trace_ids.nil? || trace_ids.empty?
|
|
18
20
|
params["graderId"] = grader_id unless grader_id.nil?
|
|
19
21
|
params["limit"] = limit unless limit.nil?
|
|
20
|
-
@http_client.get("
|
|
22
|
+
@http_client.get("#{GRADER_LABELS_PATH}?#{URI.encode_www_form(params)}")["labels"]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def save_label(grader_id:, trace_id:, label:, reason: nil, failure_diagnostic: nil, confidence: nil)
|
|
26
|
+
update = {"graderId" => grader_id, "traceId" => trace_id, "label" => label}
|
|
27
|
+
update["reason"] = reason unless reason.nil?
|
|
28
|
+
update["failureDiagnostic"] = failure_diagnostic unless failure_diagnostic.nil?
|
|
29
|
+
update["confidence"] = confidence unless confidence.nil?
|
|
30
|
+
save_label_all([update]).first
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def save_label_all(labels)
|
|
34
|
+
@http_client.request(GRADER_LABELS_PATH, {"labels" => labels})["labels"]
|
|
21
35
|
end
|
|
22
36
|
end
|
|
23
37
|
end
|
|
@@ -186,7 +186,7 @@ module Bitfab
|
|
|
186
186
|
options[:limit] = bound || 10
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
-
%i[name notes max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions dry_run].each do |key|
|
|
189
|
+
%i[name notes max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions judge_assertions dry_run].each do |key|
|
|
190
190
|
options[key] = args[key] unless args[key].nil?
|
|
191
191
|
end
|
|
192
192
|
|
|
@@ -303,6 +303,8 @@ module Bitfab
|
|
|
303
303
|
options.on("--grader-ids IDS") { |value| args[:grader_ids] = comma_separated("--grader-ids", value) }
|
|
304
304
|
options.on("--attempts N", Integer) { |value| args[:attempts] = positive_integer("--attempts", value) }
|
|
305
305
|
options.on("--only-with-assertions") { args[:only_with_assertions] = true }
|
|
306
|
+
options.on("--judge-assertions",
|
|
307
|
+
"Judge each replay's approved assertions as it finishes (costs model calls)") { args[:judge_assertions] = true }
|
|
306
308
|
options.on("--dry-run") { args[:dry_run] = true }
|
|
307
309
|
options.on("--primitive TYPE", %w[async process]) { |value| args[:primitive] = value }
|
|
308
310
|
options.on("--[no-]memory-throttle") { |value| args[:memory_throttle] = value }
|
data/lib/bitfab/version.rb
CHANGED