-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update model server * Delete model_server/.vscode/settings.json * Update loader.py * Fix errors * Update log mode
- Loading branch information
Showing
24 changed files
with
492 additions
and
1,801 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import app.commons.globals as glb | ||
import app.commons.utilities as utils | ||
import app.loader as loader | ||
|
||
from app.function_calling.model_handler import ArchFunctionHandler | ||
from app.prompt_guard.model_handler import ArchGuardHanlder | ||
|
||
|
||
arch_function_hanlder = ArchFunctionHandler() | ||
arch_function_endpoint = "https://api.fc.archgw.com/v1" | ||
arch_function_client = utils.get_client(arch_function_endpoint) | ||
arch_function_generation_params = { | ||
"temperature": 0.2, | ||
"top_p": 1.0, | ||
"top_k": 50, | ||
"max_tokens": 512, | ||
"stop_token_ids": [151645], | ||
} | ||
|
||
arch_guard_model_type = {"cpu": "katanemo/Arch-Guard-cpu", "gpu": "katanemo/Arch-Guard"} | ||
|
||
|
||
# Model definition | ||
embedding_model = loader.get_embedding_model() | ||
zero_shot_model = loader.get_zero_shot_model() | ||
|
||
prompt_guard_dict = loader.get_prompt_guard( | ||
arch_guard_model_type[glb.HARDWARE], glb.HARDWARE | ||
) | ||
|
||
arch_guard_handler = ArchGuardHanlder(model_dict=prompt_guard_dict) |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import app.commons.utilities as utils | ||
|
||
|
||
DEVICE = utils.get_device() | ||
MODE = utils.get_serving_mode() | ||
HARDWARE = utils.get_hardware(MODE) |
Oops, something went wrong.