Skip to content

Commit

Permalink
Fixing negative value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AG committed Apr 12, 2024
1 parent 7d49d3d commit 2b44cec
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 4 deletions.
Binary file modified backup/dictionary.pkl
Binary file not shown.
2 changes: 1 addition & 1 deletion backup/processing_progress.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9181988,8471999999
9477469,8743999999
Binary file modified dictionary.msgpack
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/tinypredict.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3>Quality threshold</h3>
let predictions_on_deck = [];
let last_suggestions = {};

const quality_thresholds = [0, 32, 43, 60, 80];
const quality_thresholds = [0, 29, 43, 60, 80];
let quality_threshold = quality_thresholds[2];

const set_suggestion_element = (force_remove_space=false, clear=false) => {
Expand Down Expand Up @@ -191,6 +191,7 @@ <h3>Quality threshold</h3>
const punctuation_regex = /[.\?&\*;:{}=\-_`~()]+/g;
const input = event.target.innerText.split(punctuation_regex).pop().trim();
window.getPredictiveText(input).then(suggestions => {
console.log(suggestions);
last_suggestions = suggestions;
set_debugger(suggestions);
predictions_on_deck = suggestions.prediction.filter(_prediction => _prediction.quality >= quality_threshold);
Expand Down
2 changes: 1 addition & 1 deletion tinypredict.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function run() {

return {
"completion": prediction,
"quality": quality + penalty
"quality": quality + (quality > 0 ? penalty : 0)
}
});
predictions = predictions.sort((a, b) => b.quality - a.quality);
Expand Down
Binary file modified tokens.msgpack
Binary file not shown.

0 comments on commit 2b44cec

Please sign in to comment.