Skip to content

Commit 04d7fdd

Browse files
committed
Merge branch 'main' into cli
2 parents ec619f3 + 361a0fa commit 04d7fdd

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You can run our packages with vanilla JS, without any bundler, by using a CDN or
9898
```html
9999
<script type="module">
100100
import { InferenceClient } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm';
101-
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected].0/+esm";
101+
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected].1/+esm";
102102
</script>
103103
```
104104

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@huggingface/hub",
33
"packageManager": "[email protected]",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"description": "Utilities to interact with the Hugging Face hub",
66
"repository": "https://github.com/huggingface/huggingface.js.git",
77
"publishConfig": {

packages/hub/src/lib/file-download-info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export async function fileDownloadInfo(
144144
// Cannot use resp.url in case it's a S3 url and the user adds an Authorization header to it.
145145
url:
146146
resp.url &&
147-
(new URL(resp.url).hostname === new URL(hubUrl).hostname || resp.headers.get("X-Cache")?.endsWith(" cloudfront"))
147+
(new URL(resp.url).origin === new URL(hubUrl).origin || resp.headers.get("X-Cache")?.endsWith(" cloudfront"))
148148
? resp.url
149149
: url,
150150
};

packages/tasks/src/gguf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export function findNearestQuantType(
137137
// This means finding the largest quantization that is smaller than or equal to the target.
138138
for (const availableQuant of sortedAvailable) {
139139
// We know the key exists due to the filter above.
140-
const availableIndex = orderMap.get(availableQuant)!;
140+
const availableIndex = orderMap.get(availableQuant) ?? 0;
141141
if (availableIndex >= targetIndex) {
142142
return availableQuant;
143143
}

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,17 @@ model = pe.VisionTransformer.from_config("${model.id}", pretrained=True)`;
727727
return [vision_encoder];
728728
}
729729
};
730+
export const phantom_wan = (model: ModelData): string[] => [
731+
`from huggingface_hub import snapshot_download
732+
from phantom_wan import WANI2V, configs
733+
734+
checkpoint_dir = snapshot_download("${model.id}")
735+
wan_i2v = WanI2V(
736+
config=configs.WAN_CONFIGS['i2v-14B'],
737+
checkpoint_dir=checkpoint_dir,
738+
)
739+
video = wan_i2v.generate(text_prompt, image_prompt)`,
740+
];
730741

731742
export const pyannote_audio_pipeline = (model: ModelData): string[] => [
732743
`from pyannote.audio import Pipeline

packages/tasks/src/model-libraries.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
662662
snippets: snippets.perception_encoder,
663663
countDownloads: `path_extension:"pt"`,
664664
},
665+
"phantom-wan": {
666+
prettyLabel: "Phantom",
667+
repoName: "Phantom",
668+
repoUrl: "https://github.com/Phantom-video/Phantom",
669+
snippets: snippets.phantom_wan,
670+
filter: false,
671+
countDownloads: `path_extension:"pth"`,
672+
},
665673
pxia: {
666674
prettyLabel: "pxia",
667675
repoName: "pxia",

0 commit comments

Comments
 (0)