Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 1,676 Bytes
c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf 5566043 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf cdd4011 c1f12bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
import { ComputeProvider } from '@aitube/clapper-services'
export function parseComputeProvider(
input: any,
defaultVendor?: ComputeProvider
): ComputeProvider {
let unknownString = `${input || ''}`.trim()
// the "normal" case
if (
Object.values(ComputeProvider).includes(unknownString as ComputeProvider)
) {
return unknownString as ComputeProvider
}
let vendor: ComputeProvider = defaultVendor || ComputeProvider.NONE
unknownString = unknownString.toLowerCase()
if (
unknownString === 'none' ||
unknownString === 'undefined' ||
unknownString === ''
) {
vendor = ComputeProvider.NONE
} else if (
unknownString === 'huggingface' ||
unknownString === 'hugging_face'
) {
vendor = ComputeProvider.HUGGINGFACE
} else if (unknownString === 'replicate') {
vendor = ComputeProvider.REPLICATE
} else if (unknownString === 'comfyicu' || unknownString === 'comfy.icu') {
vendor = ComputeProvider.COMFY_COMFYICU
} else if (
unknownString === 'eleven labs' ||
unknownString === 'eleven labs'
) {
vendor = ComputeProvider.ELEVENLABS
} else if (unknownString === 'openai') {
vendor = ComputeProvider.OPENAI
} else if (unknownString === 'stabilityai') {
vendor = ComputeProvider.STABILITYAI
} else if (unknownString === 'fireworksai') {
vendor = ComputeProvider.FIREWORKSAI
} else if (unknownString === 'groq') {
vendor = ComputeProvider.GROQ
} else if (unknownString === 'falai') {
vendor = ComputeProvider.FALAI
} else if (unknownString === 'modelslab') {
vendor = ComputeProvider.MODELSLAB
} else {
vendor = ComputeProvider.NONE
}
return vendor
}
|