Skip to content

Commit 5c89e98

Browse files
committed
✨ Switch to nodenext resolution
1 parent 27b995d commit 5c89e98

File tree

58 files changed

+172
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+172
-164
lines changed

packages/tasks/src/default-widget-inputs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { WidgetExample } from "./widget-example";
2-
import type { WidgetType } from "./pipelines";
1+
import type { WidgetExample } from "./widget-example.js";
2+
import type { WidgetType } from "./pipelines.js";
33

44
type LanguageCode = string;
55

packages/tasks/src/index.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export { LIBRARY_TASK_MAPPING } from "./library-to-tasks";
2-
export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs";
3-
export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks";
4-
export * from "./tasks";
1+
export { LIBRARY_TASK_MAPPING } from "./library-to-tasks.js";
2+
export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs.js";
3+
export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks/index.js";
4+
export * from "./tasks/index.js";
55
export {
66
PIPELINE_DATA,
77
PIPELINE_TYPES,
@@ -13,11 +13,15 @@ export {
1313
MODALITY_LABELS,
1414
SUBTASK_TYPES,
1515
PIPELINE_TYPES_SET,
16-
} from "./pipelines";
17-
export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ALL_MODEL_LIBRARY_KEYS, MODEL_LIBRARIES_UI_ELEMENTS } from "./model-libraries";
18-
export type { LibraryUiElement, ModelLibraryKey } from "./model-libraries";
19-
export type { ModelData, TransformersInfo } from "./model-data";
20-
export type { AddedToken, SpecialTokensMap, TokenizerConfig } from "./tokenizer-data";
16+
} from "./pipelines.js";
17+
export {
18+
ALL_DISPLAY_MODEL_LIBRARY_KEYS,
19+
ALL_MODEL_LIBRARY_KEYS,
20+
MODEL_LIBRARIES_UI_ELEMENTS,
21+
} from "./model-libraries.js";
22+
export type { LibraryUiElement, ModelLibraryKey } from "./model-libraries.js";
23+
export type { ModelData, TransformersInfo } from "./model-data.js";
24+
export type { AddedToken, SpecialTokensMap, TokenizerConfig } from "./tokenizer-data.js";
2125
export type {
2226
WidgetExample,
2327
WidgetExampleAttribute,
@@ -38,18 +42,18 @@ export type {
3842
WidgetExampleOutputLabels,
3943
WidgetExampleOutputAnswerScore,
4044
WidgetExampleOutputText,
41-
} from "./widget-example";
42-
export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data";
45+
} from "./widget-example.js";
46+
export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data.js";
4347

44-
import * as snippets from "./snippets";
45-
export * from "./gguf";
48+
import * as snippets from "./snippets/index.js";
49+
export * from "./gguf.js";
4650

4751
export { snippets };
4852

49-
export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware";
50-
export type { HardwareSpec, SkuType } from "./hardware";
51-
export { LOCAL_APPS } from "./local-apps";
52-
export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps";
53+
export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware.js";
54+
export type { HardwareSpec, SkuType } from "./hardware.js";
55+
export { LOCAL_APPS } from "./local-apps.js";
56+
export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps.js";
5357

54-
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries";
55-
export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries";
58+
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js";
59+
export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries.js";

packages/tasks/src/library-to-tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ModelLibraryKey } from "./model-libraries";
2-
import type { PipelineType } from "./pipelines";
1+
import type { ModelLibraryKey } from "./model-libraries.js";
2+
import type { PipelineType } from "./pipelines.js";
33

44
/**
55
* Mapping from library name to its supported tasks.

packages/tasks/src/local-apps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { parseGGUFQuantLabel } from "./gguf";
2-
import type { ModelData } from "./model-data";
3-
import type { PipelineType } from "./pipelines";
1+
import { parseGGUFQuantLabel } from "./gguf.js";
2+
import type { ModelData } from "./model-data.js";
3+
import type { PipelineType } from "./pipelines.js";
44

55
export interface LocalAppSnippet {
66
/**

packages/tasks/src/model-data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { PipelineType } from "./pipelines";
2-
import type { WidgetExample } from "./widget-example";
3-
import type { TokenizerConfig } from "./tokenizer-data";
1+
import type { PipelineType } from "./pipelines.js";
2+
import type { WidgetExample } from "./widget-example.js";
3+
import type { TokenizerConfig } from "./tokenizer-data.js";
44

55
/**
66
* Public interface for model metadata

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { ModelData } from "./model-data";
2-
import type { WidgetExampleTextInput, WidgetExampleSentenceSimilarityInput } from "./widget-example";
3-
import { LIBRARY_TASK_MAPPING } from "./library-to-tasks";
1+
import type { ModelData } from "./model-data.js";
2+
import type { WidgetExampleTextInput, WidgetExampleSentenceSimilarityInput } from "./widget-example.js";
3+
import { LIBRARY_TASK_MAPPING } from "./library-to-tasks.js";
44

55
const TAG_CUSTOM_CODE = "custom_code";
66

packages/tasks/src/model-libraries.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as snippets from "./model-libraries-snippets";
2-
import type { ModelData } from "./model-data";
3-
import type { ElasticSearchQuery } from "./model-libraries-downloads";
1+
import * as snippets from "./model-libraries-snippets.js";
2+
import type { ModelData } from "./model-data.js";
3+
import type { ElasticSearchQuery } from "./model-libraries-downloads.js";
44

55
/**
66
* Elements configurable by a model library.

packages/tasks/src/snippets/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ChatCompletionInputMessage, GenerationParameters } from "../tasks";
1+
import type { ChatCompletionInputMessage, GenerationParameters } from "../tasks/index.js";
22

33
export function stringifyMessages(
44
messages: ChatCompletionInputMessage[],

packages/tasks/src/snippets/curl.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { ModelDataMinimal } from "./types";
1+
import type { ModelDataMinimal } from "./types.js";
22
import { describe, expect, it } from "vitest";
3-
import { snippetTextGeneration } from "./curl";
3+
import { snippetTextGeneration } from "./curl.js";
44

55
describe("inference API snippets", () => {
66
it("conversational llm", async () => {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as inputs from "./inputs";
2-
import * as curl from "./curl";
3-
import * as python from "./python";
4-
import * as js from "./js";
1+
import * as inputs from "./inputs.js";
2+
import * as curl from "./curl.js";
3+
import * as python from "./python.js";
4+
import * as js from "./js.js";
55

66
export { inputs, curl, python, js };

0 commit comments

Comments
 (0)