Skip to content

Commit 61cb4f5

Browse files
authored
Include @huggingface/jinja in exported webpack build (#458)
In future, probably a better idea to dynamically import. However, currently it affects importing from CDNs.
1 parent 81aab02 commit 61cb4f5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/tokenizers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,7 @@ export class PreTrainedTokenizer extends Callable {
28272827
// (i.e., must be installed separately), an error is thrown if it is not installed.
28282828
let Template;
28292829
try {
2830-
Template = (await import('@huggingface/jinja')).Template;
2830+
Template = (await import( /* webpackMode: "eager" */ '@huggingface/jinja')).Template;
28312831
} catch (e) {
28322832
throw new Error(
28332833
`apply_chat_template requires '@huggingface/jinja' to be installed. ` +

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import path from 'path';
55

66
const __dirname = path.dirname(fileURLToPath(import.meta.url));
77

8+
/**
9+
* @type {import('webpack').Configuration}
10+
*/
811
export default {
912
mode: 'development',
1013
devtool: 'source-map',

0 commit comments

Comments
 (0)