Skip to content

Commit fd81d68

Browse files
Copilotjulien-c
andcommitted
Export HUB_URL and add documentation
Co-authored-by: julien-c <[email protected]>
1 parent 68d96bc commit fd81d68

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/hub/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ Remote resources and local files should be passed as `URL` whenever it's possibl
202202

203203
Under the hood, `@huggingface/hub` uses a lazy blob implementation to load the file.
204204

205+
## Constants
206+
207+
The library exports the following constants that you can use in your application:
208+
209+
- `HUB_URL`: The base URL for the Hugging Face Hub API (`https://huggingface.co`). This can be useful if you need to construct URLs or check against the default URL.
210+
211+
```ts
212+
import { HUB_URL } from "@huggingface/hub";
213+
214+
console.log(HUB_URL); // https://huggingface.co
215+
```
216+
205217
## Dependencies
206218

207219
- `@huggingface/tasks` : Typings only

packages/hub/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type {
1818
SpaceStage,
1919
} from "./types/public";
2020
export { HubApiError, InvalidApiResponseFormatError } from "./error";
21+
export { HUB_URL } from "./consts";
2122
/**
2223
* Only exported for E2Es convenience
2324
*/

0 commit comments

Comments
 (0)