leva 0.1.7 → 0.1.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d8e48a71a34a53451bc1756a6cdc7694ee6ea9747861fdb977b0859979bd101
|
4
|
+
data.tar.gz: 83c44769f588b3daeeaa6bd750f9e9b643639871de57dd381cd84a76cd6177d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74ad608263e8fe369693537d76247757bd39417bbf1e034ffc2402684a9800ed25803d1ff3506d05776c9c523ad7fd84254e78290fc99f21f7180f67e1e12667
|
7
|
+
data.tar.gz: 3a2e4b9701d6cb63c05c2f672b44c8bfd16f0de5a6a98c63e4b6a13de6685efe001cf320304be1fa1aa6c6b56cec658ec0fb95e731fbf078055d5deaffb10959
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Leva - Flexible Evaluation Framework for Language Models
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/leva)
|
4
|
+
|
3
5
|
Leva is a Ruby on Rails framework for evaluating Language Models (LLMs) using ActiveRecord datasets on production models. It provides a flexible structure for creating experiments, managing datasets, and implementing various evaluation logic on production data with security in mind.
|
4
6
|
|
5
7
|

|
@@ -13,3 +13,16 @@
|
|
13
13
|
*= require_tree .
|
14
14
|
*= require_self
|
15
15
|
*/
|
16
|
+
|
17
|
+
/* Global styles for text overflow handling */
|
18
|
+
pre {
|
19
|
+
word-wrap: break-word;
|
20
|
+
word-break: break-word;
|
21
|
+
max-width: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
textarea {
|
25
|
+
word-wrap: break-word;
|
26
|
+
word-break: break-word;
|
27
|
+
max-width: 100%;
|
28
|
+
}
|
@@ -12,7 +12,7 @@
|
|
12
12
|
</button>
|
13
13
|
</div>
|
14
14
|
<textarea
|
15
|
-
class="w-full bg-gray-800 text-white p-3 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:outline-none min-h-[100px] overflow-
|
15
|
+
class="w-full bg-gray-800 text-white p-3 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:outline-none min-h-[100px] overflow-y-auto resize-none break-words"
|
16
16
|
name="prompt[system_prompt]"
|
17
17
|
data-prompt-autosave-target="input"
|
18
18
|
id="systemPrompt"
|
@@ -31,7 +31,7 @@
|
|
31
31
|
</button>
|
32
32
|
</div>
|
33
33
|
<textarea
|
34
|
-
class="w-full bg-gray-800 text-white p-3 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:outline-none min-h-[200px] overflow-
|
34
|
+
class="w-full bg-gray-800 text-white p-3 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:outline-none min-h-[200px] overflow-y-auto resize-none break-words"
|
35
35
|
name="prompt[user_prompt]"
|
36
36
|
data-prompt-autosave-target="input"
|
37
37
|
id="userPrompt"
|
@@ -59,7 +59,7 @@
|
|
59
59
|
Copy
|
60
60
|
</button>
|
61
61
|
</summary>
|
62
|
-
<pre class="text-xs text-gray-300 mt-1 whitespace-pre-wrap" id="liquidTag<%= key %>"><%= value.to_s %></pre>
|
62
|
+
<pre class="text-xs text-gray-300 mt-1 whitespace-pre-wrap break-words overflow-x-auto max-w-full" id="liquidTag<%= key %>"><%= value.to_s %></pre>
|
63
63
|
</details>
|
64
64
|
<% end %>
|
65
65
|
</div>
|
@@ -77,7 +77,7 @@
|
|
77
77
|
Copy
|
78
78
|
</button>
|
79
79
|
</div>
|
80
|
-
<pre class="w-full bg-gray-800 text-white p-3 rounded-lg text-sm whitespace-pre-wrap" id="fullPrompt"><%= Liquid::Template.parse(@selected_prompt.user_prompt).render(@dataset_record.recordable.to_llm_context.stringify_keys) %></pre>
|
80
|
+
<pre class="w-full bg-gray-800 text-white p-3 rounded-lg text-sm whitespace-pre-wrap overflow-x-auto break-words max-w-full" id="fullPrompt"><%= Liquid::Template.parse(@selected_prompt.user_prompt).render(@dataset_record.recordable.to_llm_context.stringify_keys) %></pre>
|
81
81
|
</div>
|
82
82
|
<% end %>
|
83
83
|
<div class="text-sm text-center" data-prompt-autosave-target="status"></div>
|
@@ -102,7 +102,11 @@
|
|
102
102
|
const textareas = textarea ? [textarea] : this.inputTargets
|
103
103
|
textareas.forEach(ta => {
|
104
104
|
ta.style.height = 'auto'
|
105
|
-
ta.style.height = ta.scrollHeight + 'px'
|
105
|
+
ta.style.height = (ta.scrollHeight + 5) + 'px'
|
106
|
+
|
107
|
+
// Ensure horizontal text wrapping
|
108
|
+
ta.style.wordBreak = 'break-word'
|
109
|
+
ta.style.wordWrap = 'break-word'
|
106
110
|
})
|
107
111
|
}
|
108
112
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="w-1/2 bg-gray-900 border-l border-gray-800 p-5 overflow-y-auto" data-controller="button-loader">
|
1
|
+
<div class="w-1/2 bg-gray-900 border-l border-gray-800 p-5 overflow-y-auto overflow-x-hidden" data-controller="button-loader">
|
2
2
|
<!-- Runner Dropdown -->
|
3
3
|
<div class="mb-5">
|
4
4
|
<h3 class="text-sm font-semibold mb-2 text-indigo-300">Select Runner</h3>
|
@@ -42,17 +42,17 @@
|
|
42
42
|
<% if @dataset_record && (runner_result = @dataset_record.runner_results.last) %>
|
43
43
|
<div class="mb-3">
|
44
44
|
<h4 class="text-xs font-semibold text-indigo-200 mb-1">Ground Truth:</h4>
|
45
|
-
<pre class="text-sm text-gray-300 whitespace-pre-wrap bg-gray-700 p-2 rounded"><%= runner_result.ground_truth %></pre>
|
45
|
+
<pre class="text-sm text-gray-300 whitespace-pre-wrap break-words overflow-x-auto max-w-full bg-gray-700 p-2 rounded"><%= runner_result.ground_truth %></pre>
|
46
46
|
</div>
|
47
47
|
<div>
|
48
48
|
<h4 class="text-xs font-semibold text-indigo-200 mb-1">Raw Prediction:</h4>
|
49
|
-
<pre class="text-sm text-gray-300 whitespace-pre-wrap bg-gray-700 p-2 rounded"><%= runner_result.prediction %></pre>
|
49
|
+
<pre class="text-sm text-gray-300 whitespace-pre-wrap break-words overflow-x-auto max-w-full bg-gray-700 p-2 rounded"><%= runner_result.prediction %></pre>
|
50
50
|
</div>
|
51
51
|
<% if runner_result.dataset_record.recordable.extract_regex_pattern %>
|
52
52
|
<div>
|
53
53
|
<h4 class="text-xs font-semibold text-indigo-200 my-2 gap-2">Parsed Predictions: <%= runner_result.dataset_record.recordable.extract_regex_pattern.to_s %></h4>
|
54
54
|
<% runner_result.parsed_predictions.each do |prediction| %>
|
55
|
-
<pre class="text-sm text-gray-300 whitespace-pre-wrap bg-gray-700 p-2 rounded mb-2"><%= prediction %></pre>
|
55
|
+
<pre class="text-sm text-gray-300 whitespace-pre-wrap break-words overflow-x-auto max-w-full bg-gray-700 p-2 rounded mb-2"><%= prediction %></pre>
|
56
56
|
<% end %>
|
57
57
|
</div>
|
58
58
|
<% end %>
|
data/lib/leva/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leva
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kieran Klaassen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|