Skip to content

Commit

Permalink
fix: wrong VMtype returned by Podman Desktop causes inference servers… (
Browse files Browse the repository at this point in the history
#1549) (#1550)

* fix: wrong VMtype returned by Podman Desktop causes inference servers start failure



* fix: fix failing unit tests



---------

Signed-off-by: Jeff MAURY <[email protected]>
  • Loading branch information
jeffmaury authored Aug 15, 2024
1 parent 1372752 commit bc27e5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/managers/podmanConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class PodmanConnection extends Publisher<ContainerProviderConnectionInfo[

protected parseVMType(vmtype: string | undefined): VMType {
if (!vmtype) return VMType.UNKNOWN;
const type = VMType[vmtype.toUpperCase() as keyof typeof VMType];
const type = Object.values(VMType).find(s => s === vmtype);
if (type === undefined) {
return VMType.UNKNOWN;
}
Expand Down
6 changes: 2 additions & 4 deletions packages/backend/src/workers/provider/LlamaCppPython.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,10 @@ export class LlamaCppPython extends InferenceProvider {
case VMType.WSL:
return gpu?.vendor === GPUVendor.NVIDIA ? llamacpp.cuda : llamacpp.default;
case VMType.LIBKRUN:
case VMType.LIBKRUN_LABEL:
return gpu ? llamacpp.vulkan : llamacpp.default;
// no GPU support
case VMType.QEMU:
case VMType.APPLEHV:
case VMType.HYPERV:
case VMType.UNKNOWN:
default:
return llamacpp.default;
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/models/IPodman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
export enum VMType {
WSL = 'wsl',
LIBKRUN = 'libkrun',
LIBKRUN_LABEL = 'GPU enabled (LibKrun)',
QEMU = 'qemu',
APPLEHV = 'applehv',
APPLEHV_LABEL = 'default (Apple HyperVisor)',
HYPERV = 'hyperv',
UNKNOWN = 'unknown',
}

0 comments on commit bc27e5c

Please sign in to comment.