mirror of
https://github.com/Mintplex-Labs/transformersjs-electron.git
synced 2026-07-01 14:10:59 -04:00
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:
+1
-1
@@ -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. ` +
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user