Skip to content

Commit

Permalink
Moved startup_art to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
curvedinf committed Aug 20, 2024
1 parent 884cf46 commit 3768b77
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 38 deletions.
5 changes: 4 additions & 1 deletion dir_assistant/assistant/git_assistant.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os
import sys
import tempfile
from colorama import Style, Fore

from colorama import Fore, Style
from prompt_toolkit import prompt

from dir_assistant.assistant.cgrag_assistant import CGRAGAssistant


class GitAssistant(CGRAGAssistant):
def __init__(
self,
Expand Down
28 changes: 3 additions & 25 deletions dir_assistant/cli/start.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
import os
import sys

from colorama import Fore, Style
from llama_cpp import Llama
from prompt_toolkit import prompt
from prompt_toolkit.history import InMemoryHistory

from dir_assistant.assistant.file_watcher import start_file_watcher
from dir_assistant.assistant.index import create_file_index
from dir_assistant.assistant.lite_llm_assistant import LiteLLMAssistant
from dir_assistant.assistant.llama_cpp_assistant import LlamaCppAssistant
from dir_assistant.assistant.llama_cpp_embed import LlamaCppEmbed
from dir_assistant.cli.config import get_file_path
from dir_assistant.cli.startup_art import display_startup_art

MODELS_PATH = os.path.expanduser("~/.local/share/dir-assistant/models")

def display_startup_art(commit_to_git):
sys.stdout.write(
f"""{Style.BRIGHT}{Fore.GREEN}
_____ _____ _____
| __ \_ _| __ \
| | | || | | |__) |
| | | || | | _ /
| |__| || |_| | \ \
|_____/_____|_|_ \_\__ _____ _____ _______ _ _ _______
/\ / ____/ ____|_ _|/ ____|__ __|/\ | \ | |__ __|
/ \ | (___| (___ | | | (___ | | / \ | \| | | |
/ /\ \ \___ \\\___ \ | | \___ \ | | / /\ \ | . ` | | |
/ ____ \ ____) |___) |_| |_ ____) | | |/ ____ \| |\ | | |
/_/ \_\_____/_____/|_____|_____/ |_/_/ \_\_| \_| |_|
{Style.RESET_ALL}\n\n"""
)
sys.stdout.write(
f"{Style.BRIGHT}{Fore.BLUE}Type 'exit' to quit the conversation.\n"
)
if commit_to_git:
sys.stdout.write(
f"{Style.BRIGHT}{Fore.BLUE}Type 'undo' to roll back the last commit.\n"
)
sys.stdout.write("\n")

def start(args, config_dict):
# Load settings
llm_model_file = get_file_path(config_dict["MODELS_PATH"], config_dict["LLM_MODEL"])
Expand Down
29 changes: 29 additions & 0 deletions dir_assistant/cli/startup_art.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import sys

from colorama import Fore, Style


def display_startup_art(commit_to_git):
sys.stdout.write(
f"""{Style.BRIGHT}{Fore.GREEN}
_____ _____ _____
| __ \_ _| __ \
| | | || | | |__) |
| | | || | | _ /
| |__| || |_| | \ \
|_____/_____|_|_ \_\__ _____ _____ _______ _ _ _______
/\ / ____/ ____|_ _|/ ____|__ __|/\ | \ | |__ __|
/ \ | (___| (___ | | | (___ | | / \ | \| | | |
/ /\ \ \___ \\\___ \ | | \___ \ | | / /\ \ | . ` | | |
/ ____ \ ____) |___) |_| |_ ____) | | |/ ____ \| |\ | | |
/_/ \_\_____/_____/|_____|_____/ |_/_/ \_\_| \_| |_|
{Style.RESET_ALL}\n\n"""
)
sys.stdout.write(
f"{Style.BRIGHT}{Fore.BLUE}Type 'exit' to quit the conversation.\n"
)
if commit_to_git:
sys.stdout.write(
f"{Style.BRIGHT}{Fore.BLUE}Type 'undo' to roll back the last commit.\n"
)
sys.stdout.write("\n")
24 changes: 12 additions & 12 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh

# Ensure you first make .pypirc with appropriate tokens
#[pypi]
# username = __token__
# password =
#
#[testpypi]
# username = __token__
# password =

rm dist/*
pip install build twine
python -m build
python -m twine upload dist/*

# Ubuntu 22.04
#pip install build twine
#python -m build
#python -m twine upload dist/*

# Ubuntu 24.04
pip install pipx
pipx install build
pipx run build
pipx install twine
pipx run twine upload dist/*

0 comments on commit 3768b77

Please sign in to comment.