Skip to content

Commit cb94e61

Browse files
committed
Fix model download
1 parent 99292a3 commit cb94e61

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

web/src/stores/ModelDownloadStore.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,7 @@ export const useModelDownloadStore = create<ModelDownloadStore>((set, get) => ({
197197

198198
get().addDownload(id);
199199

200-
if (modelType.startsWith("hf.")) {
201-
const ws = await get().connectWebSocket();
202-
ws.send(
203-
JSON.stringify({
204-
command: "start_download",
205-
repo_id: repoId,
206-
path: path,
207-
allow_patterns: allowPatterns,
208-
ignore_patterns: ignorePatterns
209-
})
210-
);
211-
} else if (modelType === "llama_model") {
200+
if (modelType === "llama_model") {
212201
try {
213202
const response = await fetch(
214203
BASE_URL + "/api/models/pull_ollama_model?model_name=" + id,
@@ -259,6 +248,17 @@ export const useModelDownloadStore = create<ModelDownloadStore>((set, get) => ({
259248
get().updateDownload(id, { status: "error" });
260249
}
261250
}
251+
} else {
252+
const ws = await get().connectWebSocket();
253+
ws.send(
254+
JSON.stringify({
255+
command: "start_download",
256+
repo_id: repoId,
257+
path: path,
258+
allow_patterns: allowPatterns,
259+
ignore_patterns: ignorePatterns
260+
})
261+
);
262262
}
263263
},
264264

0 commit comments

Comments
 (0)