-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move all models to their own unique containers (#71)
* refactor: move all models to their own unique containers * fix: bug in modal object initialization * fix: logging bug * chore: remove dead code
- Loading branch information
Showing
9 changed files
with
61 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,17 @@ | ||
from pathlib import Path | ||
|
||
import modal | ||
|
||
from shared.protocol import ContainerType | ||
|
||
from .vllm_unified import ( | ||
VllmContainer_3B, | ||
VllmContainer_7B, | ||
VllmContainerA100_40G, | ||
VllmContainerA100_80G, | ||
VllmContainerA100_160G, | ||
VllmContainerA100_160G_Isolated, | ||
VllmContainer_IntelNeuralChat7B, | ||
VllmContainer_JebCarterPsyfighter13B, | ||
VllmContainer_JohnDurbinBagel34B, | ||
VllmContainer_KoboldAIPsyfighter2, | ||
VllmContainer_MicrosoftPhi2, | ||
VllmContainer_NeverSleepNoromaidMixtral8x7B, | ||
) | ||
|
||
DEFAULT_CONTAINER_TYPES = { | ||
"microsoft/phi-2": ContainerType.VllmContainer_3B, | ||
"Intel/neural-chat-7b-v3-1": ContainerType.VllmContainer_7B, | ||
# "PygmalionAI/mythalion-13b": ContainerType.VllmContainerA100_40G, | ||
"jebcarter/Psyfighter-13B": ContainerType.VllmContainerA100_40G, | ||
"KoboldAI/LLaMA2-13B-Psyfighter2": ContainerType.VllmContainerA100_40G, | ||
# "Austism/chronos-hermes-13b-v2": ContainerType.VllmContainerA100_40G, | ||
# "NeverSleep/Noromaid-20b-v0.1.1": ContainerType.VllmContainerA100_80G, | ||
# "cognitivecomputations/dolphin-2.6-mixtral-8x7b": ContainerType.VllmContainerA100_160G, | ||
"NeverSleep/Noromaid-v0.1-mixtral-8x7b-Instruct-v3": ContainerType.VllmContainerA100_160G, | ||
"jondurbin/bagel-34b-v0.2": ContainerType.VllmContainerA100_160G_Isolated, | ||
DEFAULT_CONTAINERS = { | ||
"microsoft/phi-2": VllmContainer_MicrosoftPhi2, | ||
"Intel/neural-chat-7b-v3-1": VllmContainer_IntelNeuralChat7B, | ||
"jebcarter/Psyfighter-13B": VllmContainer_JebCarterPsyfighter13B, | ||
"KoboldAI/LLaMA2-13B-Psyfighter2": VllmContainer_KoboldAIPsyfighter2, | ||
"NeverSleep/Noromaid-v0.1-mixtral-8x7b-Instruct-v3": VllmContainer_NeverSleepNoromaidMixtral8x7B, | ||
"jondurbin/bagel-34b-v0.2": VllmContainer_JohnDurbinBagel34B, | ||
} | ||
|
||
|
||
def get_container( | ||
model_path: Path, container_type: ContainerType | ||
) -> modal.cls.Obj: | ||
match container_type: | ||
case ContainerType.VllmContainer_3B: | ||
return VllmContainer_3B(model_path) | ||
case ContainerType.VllmContainer_7B: | ||
return VllmContainer_7B(model_path) | ||
case ContainerType.VllmContainerA100_40G: | ||
return VllmContainerA100_40G(model_path) | ||
case ContainerType.VllmContainerA100_80G: | ||
return VllmContainerA100_80G(model_path) | ||
case ContainerType.VllmContainerA100_80G_32K: | ||
return VllmContainerA100_80G(model_path, max_model_len=32_000) | ||
case ContainerType.VllmContainerA100_160G: | ||
return VllmContainerA100_160G(model_path) | ||
case ContainerType.VllmContainerA100_160G_Isolated: | ||
return VllmContainerA100_160G_Isolated(model_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters