Skip to content

Commit

Permalink
fix best of ux
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicoptima committed Nov 22, 2023
1 parent e685ede commit d9c7cd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "loom",
"name": "Loom",
"version": "1.20.0",
"version": "1.20.1",
"minAppVersion": "0.15.0",
"description": "Loom in Obsidian",
"author": "celeste",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-loom",
"version": "1.20.0",
"version": "1.20.1",
"description": "Loom in Obsidian",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,14 @@ export class LoomView extends ItemView {
label: string,
setting: string,
value: string,
type: "string" | "int" | "float"
type: "string" | "int" | "int?" | "float"
) => {
if (!settings.visibility[setting]) return;

const parsers = {
"string": (value: string) => value,
"int": (value: string) => parseInt(value),
"int?": (value: string) => value === "" ? 0 : parseInt(value),
"float": (value: string) => parseFloat(value),
};

Expand All @@ -364,7 +365,7 @@ export class LoomView extends ItemView {

setting("Length (in tokens)", "maxTokens", String(settings.maxTokens), "int");
setting("Number of completions", "n", String(settings.n), "int");
setting("Best of (0 = no beam search)", "bestOf", String(settings.bestOf), "int");
setting("Best of", "bestOf", settings.bestOf === 0 ? "" : String(settings.bestOf), "int?");
setting("Temperature", "temperature", String(settings.temperature), "float");
setting("Top p", "topP", String(settings.topP), "float");
setting("Frequency penalty", "frequencyPenalty", String(settings.frequencyPenalty), "float");
Expand Down

0 comments on commit d9c7cd6

Please sign in to comment.