@xenova/transformers
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@xenova/transformers", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Run 🤗 Transformers in your browser! We currently support BERT, DistilBERT, T5, GPT2, and BART models, for a variety of tasks including: masked language modelling, text classification, translation, summarization, question answering, and text generation.", | ||
@@ -5,0 +5,0 @@ "main": "./src/transformers.js", |
const fs = require('fs'); | ||
const path = require('path'); | ||
// Use caching when available | ||
const CACHE_AVAILABLE = typeof self !== 'undefined' && 'caches' in self; | ||
const FS_AVAILABLE = !isEmpty(fs); // check if file system is available | ||
@@ -118,3 +118,3 @@ class FileResponse { | ||
if (fs && !isValidHttpUrl(url)) { | ||
if (FS_AVAILABLE && !isValidHttpUrl(url)) { | ||
return new FileResponse(url) | ||
@@ -131,2 +131,6 @@ | ||
function isEmpty(obj) { | ||
return Object.keys(obj).length === 0; | ||
} | ||
async function getModelFile(modelPath, fileName, progressCallback = null) { | ||
@@ -133,0 +137,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41896370
10544