Merge pull request #4075 from janhq/fix/phi3-model-endpoint-replacement

fix: Phi 3 Mini Instruct model download url replacement
This commit is contained in:
Louis 2024-11-21 17:37:16 +07:00 committed by GitHub
commit 3c3b5bf3d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 9 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@janhq/inference-cortex-extension", "name": "@janhq/inference-cortex-extension",
"productName": "Cortex Inference Engine", "productName": "Cortex Inference Engine",
"version": "1.0.21", "version": "1.0.22",
"description": "This extension embeds cortex.cpp, a lightweight inference engine written in C++. See https://jan.ai.\nAdditional dependencies could be installed to run without Cuda Toolkit installation.", "description": "This extension embeds cortex.cpp, a lightweight inference engine written in C++. See https://jan.ai.\nAdditional dependencies could be installed to run without Cuda Toolkit installation.",
"main": "dist/index.js", "main": "dist/index.js",
"node": "dist/node/index.cjs.js", "node": "dist/node/index.cjs.js",

View File

@ -1,8 +1,8 @@
{ {
"sources": [ "sources": [
{ {
"url": "https://huggingface.co/cortexso/phi3/resolve/main/model.gguf", "url": "https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF/resolve/main/Phi-3-mini-4k-instruct-Q4_K_M.gguf",
"filename": "model.gguf" "filename": "Phi-3-mini-4k-instruct-Q4_K_M.gguf"
} }
], ],
"id": "phi3-3.8b", "id": "phi3-3.8b",
@ -14,7 +14,7 @@
"settings": { "settings": {
"ctx_len": 4096, "ctx_len": 4096,
"prompt_template": "<|user|>\n{prompt}<|end|>\n<|assistant|>\n", "prompt_template": "<|user|>\n{prompt}<|end|>\n<|assistant|>\n",
"llama_model_path": "model.gguf", "llama_model_path": "Phi-3-mini-4k-instruct-Q4_K_M.gguf",
"ngl": 33 "ngl": 33
}, },
"parameters": { "parameters": {

View File

@ -1,8 +1,8 @@
{ {
"sources": [ "sources": [
{ {
"url": "https://huggingface.co/bartowski/Phi-3-medium-128k-instruct-GGUF/resolve/main/Phi-3-medium-128k-instruct-Q4_K_M.gguf", "url": "https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF/resolve/main/Phi-3-mini-4k-instruct-Q4_K_M.gguf",
"filename": "Phi-3-medium-128k-instruct-Q4_K_M.gguf" "filename": "Phi-3-mini-4k-instruct-Q4_K_M.gguf"
} }
], ],
"id": "phi3-medium", "id": "phi3-medium",
@ -14,7 +14,7 @@
"settings": { "settings": {
"ctx_len": 128000, "ctx_len": 128000,
"prompt_template": "<|user|> {prompt}<|end|><|assistant|>", "prompt_template": "<|user|> {prompt}<|end|><|assistant|>",
"llama_model_path": "Phi-3-medium-128k-instruct-Q4_K_M.gguf", "llama_model_path": "Phi-3-mini-4k-instruct-Q4_K_M.gguf",
"ngl": 33 "ngl": 33
}, },
"parameters": { "parameters": {

View File

@ -90,12 +90,15 @@ const useModels = () => {
const toUpdate = [ const toUpdate = [
...downloadedModels, ...downloadedModels,
...cachedModels.filter( ...cachedModels.filter(
(e: Model) => !downloadedModels.some((g: Model) => g.id === e.id) (e) =>
!isLocalEngine(e.engine) &&
!downloadedModels.some((g: Model) => g.id === e.id)
), ),
] ]
setDownloadedModels(toUpdate) setDownloadedModels(toUpdate)
}, [downloadedModels, setDownloadedModels]) setExtensionModels(cachedModels)
}, [downloadedModels, setDownloadedModels, setExtensionModels])
const getModels = async (): Promise<Model[]> => const getModels = async (): Promise<Model[]> =>
extensionManager extensionManager