Hansimov commited on
Commit
5c69aa3
·
1 Parent(s): 0613e49

:recycle: [Refactor] Remove deprecated model loader scripts

Browse files
Files changed (1) hide show
  1. components/llm_models_loader.js +5 -96
components/llm_models_loader.js CHANGED
@@ -1,32 +1,7 @@
1
- import { available_models, AvailableModelsRequester } from "../networks/llm_requester.js";
2
-
3
- export async function setup_hardcoded_available_models_on_select(
4
- default_option = null
5
- ) {
6
- var select = $("#available-models-select");
7
- select.empty();
8
- const hardcoded_models = [
9
- "precise",
10
- "balanced",
11
- "creative",
12
- "precise-offline",
13
- "balanced-offline",
14
- "creative-offline",
15
- ];
16
- hardcoded_models.forEach((value, index) => {
17
- const option = new Option(value, value);
18
- select.append(option);
19
- });
20
- let default_model = "precise";
21
- let local_default_model = localStorage.getItem("default_model");
22
- if (local_default_model && hardcoded_models.includes(local_default_model)) {
23
- default_model = local_default_model;
24
- } else {
25
- localStorage.setItem("default_model", default_model);
26
- }
27
- select.val(default_model);
28
- console.log(`Default model: ${select.val()}`);
29
- }
30
 
31
  export async function setup_available_models_on_select(default_option = null) {
32
  var select = $("#available-models-select");
@@ -39,9 +14,7 @@ export async function setup_available_models_on_select(default_option = null) {
39
  });
40
  let default_model = "";
41
  let local_default_model = localStorage.getItem("default_model");
42
- if (
43
- local_default_model && available_models.includes(local_default_model)
44
- ) {
45
  default_model = local_default_model;
46
  } else if (available_models) {
47
  default_model = available_models[0];
@@ -54,70 +27,6 @@ export async function setup_available_models_on_select(default_option = null) {
54
  console.log(`Default model: ${select.val()}`);
55
  }
56
 
57
- export async function setup_working_available_models_on_select(default_option = null) {
58
- var select = $("#available-models-select");
59
- select.empty();
60
- await request_available_models();
61
- const working_models = [
62
- "bing-precise",
63
- "bing-balanced",
64
- "bing-creative",
65
- // "bing-dall-e", // not work
66
- // "bing-gpt-4", // not work
67
- // "bing-gpt-4-32k", // not work
68
- // "bingo-precise", // in progress
69
- // "bingo-balanced", // in progress
70
- // "bingo-creative", // in progress
71
- "claude-2",
72
- "gpt-3.5-turbo",
73
- "gpt-3.5-turbo-internet",
74
- // "gpt-4", // not work
75
- // "gpt-4-32k", // not work
76
- // "gpt-4-internet", // not work
77
- // "pandora-gpt-3.5-turbo", // not work
78
- // "poe-claude-2-100k", // not work
79
- "poe-claude-instant",
80
- "poe-claude-instant-100k",
81
- // "poe-code-llama-13b",
82
- // "poe-code-llama-34b",
83
- // "poe-code-llama-7b",
84
- // "poe-dolly-v2-12b", // not work
85
- "poe-google-palm",
86
- "poe-gpt-3.5-turbo",
87
- // "poe-gpt-3.5-turbo-16k", // not work
88
- "poe-gpt-3.5-turbo-instruct",
89
- // "poe-gpt-4", // not work
90
- // "poe-gpt-4-32k", // not work
91
- // "poe-llama-2-13b",
92
- // "poe-llama-2-70b",
93
- // "poe-llama-2-7b",
94
- // "poe-nous-hermes-13b",
95
- // "poe-nous-hermes-l2-13b", // not work
96
- "poe-saga",
97
- "poe-solar-0-70b",
98
- // "poe-stablediffusion-xl", // not work
99
- // "poe-starcoderchat", // not work
100
- "poe-web-search",
101
- ];
102
- working_models.forEach((value, index) => {
103
- const option = new Option(value, value);
104
- if (available_models.includes(value)) {
105
- select.append(option);
106
- }
107
- });
108
- let default_model = "gpt-turbo-3.5";
109
- let local_default_model = localStorage.getItem("default_model");
110
- if (
111
- local_default_model &&
112
- working_models.includes(local_default_model) &&
113
- available_models.includes(local_default_model)
114
- ) {
115
- default_model = local_default_model;
116
- }
117
- select.val(default_model);
118
- console.log(`Default model: ${select.val()}`);
119
- }
120
-
121
  export async function setup_temperature_on_select(default_option = null) {
122
  var select = $("#temperature-select");
123
  select.empty();
 
1
+ import {
2
+ available_models,
3
+ AvailableModelsRequester,
4
+ } from "../networks/llm_requester.js";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  export async function setup_available_models_on_select(default_option = null) {
7
  var select = $("#available-models-select");
 
14
  });
15
  let default_model = "";
16
  let local_default_model = localStorage.getItem("default_model");
17
+ if (local_default_model && available_models.includes(local_default_model)) {
 
 
18
  default_model = local_default_model;
19
  } else if (available_models) {
20
  default_model = available_models[0];
 
27
  console.log(`Default model: ${select.val()}`);
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  export async function setup_temperature_on_select(default_option = null) {
31
  var select = $("#temperature-select");
32
  select.empty();