Include @huggingface/jinja in exported webpack build (#458)

In future, probably a better idea to dynamically import. However, currently it affects importing from CDNs.
This commit is contained in:
Joshua Lochner
2023-12-18 20:23:40 +02:00
committed by GitHub
parent 81aab022ff
commit 61cb4f5c3a
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -2827,7 +2827,7 @@ export class PreTrainedTokenizer extends Callable {
// (i.e., must be installed separately), an error is thrown if it is not installed.
let Template;
try {
Template = (await import('@huggingface/jinja')).Template;
Template = (await import( /* webpackMode: "eager" */ '@huggingface/jinja')).Template;
} catch (e) {
throw new Error(
`apply_chat_template requires '@huggingface/jinja' to be installed. ` +
+3
View File
@@ -5,6 +5,9 @@ import path from 'path';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/**
* @type {import('webpack').Configuration}
*/
export default {
mode: 'development',
devtool: 'source-map',