generated from AGISwarm/python-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc8e48f
commit c557d5b
Showing
21 changed files
with
225 additions
and
229 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ __pycache__/ | |
.cache | ||
|
||
# due to using vscode | ||
.vscode/ | ||
.vscode/ | ||
outputs/ |
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,4 @@ | ||
python -m pylint src | ||
python -m pyright src | ||
python -m black src --check | ||
python -m isort src --check-only |
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,17 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
engine: !!str VLLMEngine | ||
|
||
model_name: !!str "DevsDoCode/LLama-3-8b-Uncensored" | ||
hf_model_name: !!str "Orenguteng/Llama-3-8B-Lexi-Uncensored-GGUF" | ||
tokenizer_name: "meta-llama/Meta-Llama-3-8B-Instruct" | ||
|
||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
engine: !!str VLLMEngine | ||
engine_config: | ||
|
||
gui_title: !!str "LLama-3-8b-Uncensored" | ||
default_max_new_tokens: !!int 1000 | ||
default_temperature: !!float 0.6 | ||
default_top_p: !!float 0.95 | ||
default_repetition_penalty: !!float 1.2 | ||
default_frequency_penalty: !!float 0.0 | ||
default_presence_penalty: !!float 0.0 | ||
defaults: | ||
- gui_config: default | ||
- uvicorn_config: default |
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,18 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
engine: !!str HFEngine | ||
|
||
model_name: !!str RichardErkhov/IlyaGusev_-_saiga_llama3_8b-4bits | ||
hf_model_name: !!str RichardErkhov/IlyaGusev_-_saiga_llama3_8b-4bits | ||
tokenizer_name: !!str RichardErkhov/IlyaGusev_-_saiga_llama3_8b-4bits | ||
# filename: !!str "*Q4_K_M.gguf" | ||
|
||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
gui_title: !!str "LLama-3-8b-Uncensored" | ||
engine: !!str HFEngine | ||
engine_config: | ||
|
||
default_max_new_tokens: !!int 1000 | ||
default_temperature: !!float 0.6 | ||
default_top_p: !!float 0.95 | ||
default_repetition_penalty: !!float 1.2 | ||
default_frequency_penalty: !!float 0.0 | ||
default_presence_penalty: !!float 0.0 | ||
defaults: | ||
- gui_config: default | ||
- uvicorn_config: default |
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,19 +1,14 @@ | ||
%YAML 1.1 | ||
--- | ||
engine: !!str LlamaCppEngine | ||
|
||
model_name: !!str "Orenguteng/Llama-3-8B-Lexi-Uncensored-GGUF" | ||
hf_model_name: !!str "Orenguteng/Llama-3-8B-Lexi-Uncensored-GGUF" | ||
tokenizer_name: !!str "meta-llama/Meta-Llama-3-8B-Instruct" | ||
filename: !!str "*Q4_K_M.gguf" | ||
n_gpu_layers: 0 | ||
|
||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
gui_title: !!str "LLama-3-8b-Uncensored-4bit-pruned" | ||
engine: !!str LlamaCppEngine | ||
engine_config: | ||
filename: !!str "*Q4_K_M.gguf" | ||
n_gpu_layers: 0 | ||
|
||
default_max_new_tokens: !!int 1000 | ||
default_temperature: !!float 0.6 | ||
default_top_p: !!float 0.95 | ||
default_repetition_penalty: !!float 1.2 | ||
default_frequency_penalty: !!float 0.0 | ||
default_presence_penalty: !!float 0.0 | ||
defaults: | ||
- gui_config: default | ||
- uvicorn_config: default |
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,18 +1,13 @@ | ||
|
||
%YAML 1.1 | ||
--- | ||
engine: !!str VLLMEngine | ||
|
||
model_name: !!str "Vikhrmodels/Vikhr-7B-instruct_0.2" | ||
hf_model_name: !!str "Vikhrmodels/Vikhr-7B-instruct_0.2" | ||
tokenizer_name: "Vikhrmodels/Vikhr-7B-instruct_0.2" | ||
|
||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
engine: !!str VLLMEngine | ||
engine_config: | ||
|
||
gui_title: !!str "Vikhr-7B-instruct_0.2" | ||
default_max_new_tokens: !!int 1000 | ||
default_temperature: !!float 0.6 | ||
default_top_p: !!float 0.95 | ||
default_repetition_penalty: !!float 1.2 | ||
default_frequency_penalty: !!float 0.0 | ||
default_presence_penalty: !!float 0.0 | ||
defaults: | ||
- gui_config: default | ||
- uvicorn_config: default |
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,7 @@ | ||
default_sampling_config: | ||
max_new_tokens: !!int 1000 | ||
temperature: !!float 0.6 | ||
top_p: !!float 0.95 | ||
repetition_penalty: !!float 1.2 | ||
frequency_penalty: !!float 0.0 | ||
presence_penalty: !!float 0.0 |
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,16 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
engine: !!str VLLMEngine | ||
|
||
model_name: !!str "meta-llama/Meta-Llama-3-8B-Instruct" | ||
hf_model_name: !!str "meta-llama/Meta-Llama-3-8B-Instruct" | ||
tokenizer_name: !!str "meta-llama/Meta-Llama-3-8B-Instruct" | ||
|
||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
gui_title: !!str "meta-llama/Meta-Llama-3-8B-Instruct" | ||
engine: !!str VLLMEngine | ||
engine_config: | ||
|
||
default_max_new_tokens: !!int 1000 | ||
default_temperature: !!float 0.6 | ||
default_top_p: !!float 0.95 | ||
default_repetition_penalty: !!float 1.2 | ||
default_frequency_penalty: !!float 0.0 | ||
default_presence_penalty: !!float 0.0 | ||
defaults: | ||
- gui_config: default | ||
- uvicorn_config: default |
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,4 @@ | ||
host: !!str "127.0.0.1" | ||
port: !!int 8000 | ||
log_level: !!str debug | ||
loop: !!str asyncio |
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,25 +1,30 @@ | ||
"""Main module for the LLM instruct microservice""" | ||
|
||
from argparse import ArgumentParser | ||
import os | ||
from pathlib import Path | ||
|
||
import hydra | ||
import uvicorn | ||
|
||
from .app import LLMInstructApp | ||
from .settings import LLMInstructSettings | ||
from .typing import LLMInstructConfig | ||
|
||
|
||
def main(): | ||
@hydra.main( | ||
config_path=str(Path(os.getcwd()) / "config"), | ||
) | ||
def main(config: LLMInstructConfig): | ||
"""Main function""" | ||
parser = ArgumentParser() | ||
parser.add_argument("--config", type=str, help="Path to the configuration file") | ||
|
||
args = parser.parse_args() | ||
yaml_path = args.config | ||
|
||
settings = LLMInstructSettings.from_yaml(yaml_path) | ||
llm_instruct_app = LLMInstructApp(settings) | ||
uvicorn.run(llm_instruct_app.app, host=settings.host, port=settings.port) | ||
llm_instruct_app = LLMInstructApp(config) | ||
uvicorn.run( | ||
llm_instruct_app.app, | ||
host=config.uvicorn_config.host, | ||
port=config.uvicorn_config.port, | ||
log_level=config.uvicorn_config.log_level, | ||
loop=config.uvicorn_config.loop, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() # pylint: disable=no-value-for-parameter |
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 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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.