Skip to content

Commit

Permalink
Fix: Include .mjs in package.json (#98)
Browse files Browse the repository at this point in the history
Fix the package.json to include the .mjs file.
Javascript version does not seem to work otherwise.
  • Loading branch information
djacobs7 authored Jan 3, 2025
1 parent 7b79dbd commit 0982ca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ yarn add uform
```js
import { getModel, Modality, TextProcessor, TextEncoder, ImageEncoder, ImageProcessor } from '@unum-cloud/uform';

const { configPath, modalityPaths, tokenizerPath } = await getModel({
const { configPath, modalityPaths, tokenizerPath } = await getModel(
modelId: 'unum-cloud/uform3-image-text-english-small',
modalities: [Modality.TextEncoder, Modality.ImageEncoder],
token: null, // Optional Hugging Face token for private models
saveDir: null, // Optional directory to save the model to
});
modalities: [Modality.TextEncoder, Modality.ImageEncoder]
);

const textProcessor = new TextProcessor(configPath, tokenizerPath);
await textProcessor.init();
const processedTexts = await textProcessor.process("a small red panda in a zoo");
const processedTexts = await textProcessor.process(["a small red panda in a zoo"]);

const textEncoder = new TextEncoder(modalityPaths.text_encoder, textProcessor);
await textEncoder.init();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"files": [
"javascript/index.mjs",
"javascript/encoders.mjs",
"javascript/hub.js"
"javascript/hub.mjs"
],
"directories": {
"doc": "docs"
Expand All @@ -34,4 +34,4 @@
],
"author": "Ash Vardanian, Unum Cloud",
"license": "Apache-2.0"
}
}

0 comments on commit 0982ca8

Please sign in to comment.