@huggingface/inference 2.0.0-rc2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ function makeRequestOptions(args, options) {
96
96
  headers["X-Load-Model"] = "0";
97
97
  }
98
98
  }
99
- const url = /^http(s?):/.test(model) ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
99
+ const url = /^http(s?):/.test(model) || model.startsWith("/") ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
100
100
  const info = {
101
101
  headers,
102
102
  method: "POST",
package/dist/index.mjs CHANGED
@@ -53,7 +53,7 @@ function makeRequestOptions(args, options) {
53
53
  headers["X-Load-Model"] = "0";
54
54
  }
55
55
  }
56
- const url = /^http(s?):/.test(model) ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
56
+ const url = /^http(s?):/.test(model) || model.startsWith("/") ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
57
57
  const info = {
58
58
  headers,
59
59
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/inference",
3
- "version": "2.0.0-rc2",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",
6
6
  "description": "Typescript wrapper for the Hugging Face Inference API",
@@ -38,7 +38,7 @@ export function makeRequestOptions(
38
38
  }
39
39
  }
40
40
 
41
- const url = /^http(s?):/.test(model) ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
41
+ const url = /^http(s?):/.test(model) || model.startsWith("/") ? model : `${HF_INFERENCE_API_BASE_URL}${model}`;
42
42
  const info: RequestInit = {
43
43
  headers,
44
44
  method: "POST",