generaltranslation 1.0.14 → 1.0.16

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.
Files changed (2) hide show
  1. package/models/models.js +18 -12
  2. package/package.json +1 -1
package/models/models.js CHANGED
@@ -5,19 +5,25 @@ let AliasToModel = null;
5
5
 
6
6
  // Fetches models and aliases from the server and caches them
7
7
  const fetchModelData = async () => {
8
- if (!Models || !AliasToModel) {
9
- const results = await Promise.all([
10
- fetch('https://data.gtx.dev/models.json'),
11
- fetch('https://data.gtx.dev/alias_to_model.json')
12
- ])
13
- const values = await Promise.all([
14
- results[0].json(),
15
- results[1].json()
16
- ])
17
- Models = values[0];
18
- AliasToModel = values[1];
8
+ try {
9
+ console.log('Fetching model data...')
10
+ if (!Models || !AliasToModel) {
11
+ const results = await Promise.all([
12
+ fetch('https://data.gtx.dev/models.json'),
13
+ fetch('https://data.gtx.dev/alias_to_model.json')
14
+ ])
15
+ const values = await Promise.all([
16
+ results[0].json(),
17
+ results[1].json()
18
+ ])
19
+ Models = values[0];
20
+ AliasToModel = values[1];
21
+ }
22
+ return [Models, AliasToModel];
23
+ } catch (error) {
24
+ console.error(error);
25
+ return [null, null];
19
26
  }
20
- return [Models, AliasToModel];
21
27
  }
22
28
 
23
29
  // ----- MODEL INFORMATION ----- //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "index.js",
6
6
  "scripts": {