You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils/hub.js
+17-12Lines changed: 17 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
2
2
/**
3
3
* @file Utility functions to interact with the Hugging Face Hub (https://huggingface.co/models)
4
-
*
4
+
*
5
5
* @module utils/hub
6
6
*/
7
7
@@ -19,7 +19,7 @@ import { dispatchCallback } from './core.js';
19
19
exportconstMAX_EXTERNAL_DATA_CHUNKS=100;
20
20
21
21
/**
22
-
* @typedef {Object} PretrainedOptions Options for loading a pretrained model.
22
+
* @typedef {Object} PretrainedOptions Options for loading a pretrained model.
23
23
* @property {import('./core.js').ProgressCallback} [progress_callback=null] If specified, this function will be called during model construction, to provide the user with progress updates.
24
24
* @property {import('../configs.js').PretrainedConfig} [config=null] Configuration for the model to use instead of an automatically loaded configuration. Configuration can be automatically loaded when:
25
25
* - The model is a model provided by the library (loaded with the *model id* string of a pretrained model).
@@ -158,7 +158,7 @@ class FileResponse {
158
158
/**
159
159
* Reads the contents of the file specified by the filePath property and returns a Promise that
160
160
* resolves with a parsed JavaScript object containing the file's contents.
161
-
*
161
+
*
162
162
* @returns {Promise<Object>} A Promise that resolves with a parsed JavaScript object containing the file's contents.
* Tests whether a string is a valid Hugging Face model ID or not.
197
197
* Adapted from https://github.com/huggingface/huggingface_hub/blob/6378820ebb03f071988a96c7f3268f5bdf8f9449/src/huggingface_hub/utils/_validators.py#L119-L170
198
-
*
198
+
*
199
199
* @param {string} string The string to test
200
200
* @returns {boolean} True if the string is a valid model ID, false otherwise.
201
201
*/
@@ -214,9 +214,14 @@ function isValidHfModelId(string) {
0 commit comments