File size: 2,812 Bytes
38447f7
 
 
f5223c1
6e6dab9
 
 
 
 
7941ee3
 
 
 
 
eff6959
 
844ba40
 
 
7941ee3
 
 
eff6959
 
 
7941ee3
 
 
 
 
 
 
 
 
 
 
 
eff6959
 
7941ee3
 
 
 
 
eff6959
 
7941ee3
 
 
 
 
fb77726
7941ee3
 
 
6e6dab9
af8a4b7
eff6959
 
 
 
 
 
 
af8a4b7
 
fb77726
6e6dab9
bdd842c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import {
    request_available_models,
    available_models,
} from "../networks/llm_requester.js";

export async function setup_available_models_on_select(default_option = null) {
    var select = $("#available-models-select");
    select.empty();
    await request_available_models();
    const working_models = [
        "bing-precise",
        "bing-balanced",
        "bing-creative",
        // "bing-dall-e", // not work
        // "bing-gpt-4", // not work
        // "bing-gpt-4-32k", // not work
        // "bingo-precise", // in progress
        // "bingo-balanced", // in progress
        // "bingo-creative", // in progress
        "claude-2",
        "gpt-3.5-turbo",
        "gpt-3.5-turbo-internet",
        // "gpt-4", // not work
        // "gpt-4-32k", // not work
        // "gpt-4-internet", // not work
        // "pandora-gpt-3.5-turbo", // not work
        // "poe-claude-2-100k", // not work
        "poe-claude-instant",
        "poe-claude-instant-100k",
        // "poe-code-llama-13b",
        // "poe-code-llama-34b",
        // "poe-code-llama-7b",
        // "poe-dolly-v2-12b", // not work
        "poe-google-palm",
        "poe-gpt-3.5-turbo",
        // "poe-gpt-3.5-turbo-16k", // not work
        "poe-gpt-3.5-turbo-instruct",
        // "poe-gpt-4", // not work
        // "poe-gpt-4-32k", // not work
        // "poe-llama-2-13b",
        // "poe-llama-2-70b",
        // "poe-llama-2-7b",
        // "poe-nous-hermes-13b",
        // "poe-nous-hermes-l2-13b", // not work
        "poe-saga",
        "poe-solar-0-70b",
        // "poe-stablediffusion-xl", // not work
        // "poe-starcoderchat", // not work
        "poe-web-search",
    ];
    working_models.forEach((value, index) => {
        const option = new Option(value, value);
        if (available_models.includes(value)) {
            select.append(option);
        }
    });
    let default_model = "gpt-turbo-3.5";
    let local_default_model = localStorage.getItem("default_model");
    if (
        local_default_model &&
        working_models.includes(local_default_model) &&
        available_models.includes(local_default_model)
    ) {
        default_model = local_default_model;
    }
    select.val(default_model);
    console.log(`Default model: ${select.val()}`);
}

export async function setup_temperature_on_select(default_option = null) {
    var select = $("#temperature-select");
    select.empty();
    if (default_option === null) {
        default_option = "0";
    }
    for (let i = 10; i >= 0; i--) {
        const value = i / 10;
        const option = new Option(value, value);
        select.append(option);
        if (value === Number(default_option)) {
            $(option).prop("selected", true);
        }
    }
    console.log(`Default temperature: ${select.val()}`);
}