Skip to content

Commit

Permalink
Merge pull request #129 from dbpunk-labs/125-ping-the-agent-service-t…
Browse files Browse the repository at this point in the history
…o-check-the-healthy-when-setup-the-octogen

feat: change the default codellama model
  • Loading branch information
imotai authored Oct 7, 2023
2 parents ee5cee6 + 9cf9648 commit 01230b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cli_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- name: Run cli tests
shell: bash
run: |
bash build_package.sh
cd up
pip install .
pytest tests/*.py
12 changes: 8 additions & 4 deletions up/src/og_up/up.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ def run_install_cli(live, segments):
result_code = 0
refresh(live, segments)
outputs = ""
for code, output in run_with_realtime_print(command=["pip", "install", "og_chat"]):
for code, output in run_with_realtime_print(command=["pip", "install", "-U", "og_proto",
"og_sdk", "og_chat"]):
outputs += output
result_code = code
if result_code == 0:
segments.pop()
segments.append(("✅", "Install octogen terminal cli", ""))
refresh(live, segments)
return True
else:
segments.pop()
segments.append(("❌", "Install octogen terminal cli", outputs))
refresh(live, segments)
refresh(live, segments)
return False


def run_with_realtime_print(
Expand Down Expand Up @@ -680,7 +684,7 @@ def start_octogen_for_codellama(
)
@click.option(
"--model_filename",
default="codellama-7b-instruct.Q5_K_S.gguf",
default="codellama-7b-instruct.Q5_K_M.gguf",
help="the model filename in model repo",
)
@click.option(
Expand Down Expand Up @@ -721,7 +725,7 @@ def init_octogen(
refresh(live, segments)
return
update_cli_config(live, segments, key, real_cli_dir, api_base)
if ping_agent_service(live, segments, kernel_key, api_base):
if ping_agent_service(live, segments, key, api_base):
segments.append(("👍", "Setup octogen cli done", ""))
else:
segments.append(("❌", "Setup octogen cli failed", ""))
Expand Down
7 changes: 7 additions & 0 deletions up/tests/up_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from og_up.up import generate_agent_common, generate_agent_azure_openai, generate_agent_openai, generate_agent_codellama
from og_up.up import generate_kernel_env
from og_up.up import check_the_env
from og_up.up import run_install_cli
from rich.console import Group
from dotenv import dotenv_values

Expand Down Expand Up @@ -147,6 +148,12 @@ def test_get_version():
assert "v0.1.0" == version


def test_install_cli():
console = Console()
segments = []
with Live(Group(*segments), console=console) as live:
assert run_install_cli(live, segments)

@pytest.mark.skipif(sys.platform.startswith("win"), reason="skip on windows")
def test_start_azure_openai_smoketest():
console = Console()
Expand Down

0 comments on commit 01230b2

Please sign in to comment.