Your personal assistant directly integrated into your terminal.
Copilo.sh is a wrapper function to add to your .bashrc or .zshrc file. Accompanied by a FastAPI local server, running a LM on CPU. It will catch all the errors you make in your terminal (non-zero exit code) and call the LM to generate a response to help you solve the error.
Set up the environnements:
Create a conda environnement:
conda create -n copilosh_env python=3.8 poetry=1.4.0 --y
conda activate copilosh_env
poetry lock --no-update # TO AVOID AUTO-UPDATE
poetry install
Create a cache directory, to store your models:
mkdir cache
Add the copilosh wrapper function to your shell profile file (e.g. ~/.bashrc, ~/.zshrc, etc.):
Ubuntu/Unix:
cat copilosh.sh >> ~/.bashrc
source ~/.bashrc .
MacOS:
cat copilosh.sh >> ~/.zshrc
source ~/.zshrc .
Run the assistant server:
uvicorn app:app --host 0.0.0.0 --port 8082
Use any command in your terminal, if an error occurs, the assistant will suggest a solution.
├── create_response_dataset.py # creates a yaml file with all the generated responses for each model, for each
│ # system prompt, each 'pre_prompt' and each error
├── create_test_suite.py # runs the error scripts and creates the test suite in a yaml file
├── evaluation
│ ├── evaluation.ipynb # notebook for statistical analysis of the evaluation results
│ ├── evaluation.py # script to evaluate the models (BLEU, ROUGE, BERTScore, response time, rank)
│ ├── expected_responses.yml # contains baseline responses for the 24 common errors by ChatGPT
│ ├── model_ranker.py # tool to ease the model ranking
│ ├── preprompt_ranker.py # tool to ease the pre-prompt ranking
│ └── system_prompt_ranker.py # tool to ease the system prompt ranking
├── models
│ └── slm.py # contains the models to generate responses (11)
├── pre_prompts.yml # contains the pre-prompts (few-shot, CoT) (2)
├── system_prompts.yml # contains the system prompts (6)
├── test_models.py # pytest to one-time test the models in the models folder
└── test_scripts # contains the scripts to get the 24 common errors
└──...
cd tests
python create_test_suite.py
A file test_suite_results.yml will be created in the tests folder.
Containing a list of yaml object:
python create_response_dataset.py
A file response_dataset.yml will be created in the tests folder.
Containing a list of yaml object:
cd evaluation
python evaluation.py
A csv file will be created in the evaluation folder.
python model_ranker.py
A csv file will be created in the evaluation folder.
6.2. System prompt ranking
python system_prompt_ranker.py
Same as the model ranking, but you will have to first input the name of the model you prefer.
A csv file will be created in the evaluation folder.
6.3. Pre-prompt ranking
python preprompt_ranker.py
Same as the model ranking, but you will have to first input the name of the model you prefer and the system prompt you prefer.
A csv file will be created in the evaluation folder.
You can look at the notebook to see the statistical analysis of the evaluation results.
Jupyter Notebook
97.4%
Python
2.6%
Your personal assistant directly integrated into your terminal.
Copilo.sh is a wrapper function to add to your .bashrc or .zshrc file. Accompanied by a FastAPI local server, running a LM on CPU. It will catch all the errors you make in your terminal (non-zero exit code) and call the LM to generate a response to help you solve the error.
Set up the environnements:
Create a conda environnement:
conda create -n copilosh_env python=3.8 poetry=1.4.0 --y
conda activate copilosh_env
poetry lock --no-update # TO AVOID AUTO-UPDATE
poetry install
Create a cache directory, to store your models:
mkdir cache
Add the copilosh wrapper function to your shell profile file (e.g. ~/.bashrc, ~/.zshrc, etc.):
Ubuntu/Unix:
cat copilosh.sh >> ~/.bashrc
source ~/.bashrc .
MacOS:
cat copilosh.sh >> ~/.zshrc
source ~/.zshrc .
Run the assistant server:
uvicorn app:app --host 0.0.0.0 --port 8082
Use any command in your terminal, if an error occurs, the assistant will suggest a solution.
├── create_response_dataset.py # creates a yaml file with all the generated responses for each model, for each
│ # system prompt, each 'pre_prompt' and each error
├── create_test_suite.py # runs the error scripts and creates the test suite in a yaml file
├── evaluation
│ ├── evaluation.ipynb # notebook for statistical analysis of the evaluation results
│ ├── evaluation.py # script to evaluate the models (BLEU, ROUGE, BERTScore, response time, rank)
│ ├── expected_responses.yml # contains baseline responses for the 24 common errors by ChatGPT
│ ├── model_ranker.py # tool to ease the model ranking
│ ├── preprompt_ranker.py # tool to ease the pre-prompt ranking
│ └── system_prompt_ranker.py # tool to ease the system prompt ranking
├── models
│ └── slm.py # contains the models to generate responses (11)
├── pre_prompts.yml # contains the pre-prompts (few-shot, CoT) (2)
├── system_prompts.yml # contains the system prompts (6)
├── test_models.py # pytest to one-time test the models in the models folder
└── test_scripts # contains the scripts to get the 24 common errors
└──...
cd tests
python create_test_suite.py
A file test_suite_results.yml will be created in the tests folder.
Containing a list of yaml object:
python create_response_dataset.py
A file response_dataset.yml will be created in the tests folder.
Containing a list of yaml object:
cd evaluation
python evaluation.py
A csv file will be created in the evaluation folder.
python model_ranker.py
A csv file will be created in the evaluation folder.
6.2. System prompt ranking
python system_prompt_ranker.py
Same as the model ranking, but you will have to first input the name of the model you prefer.
A csv file will be created in the evaluation folder.
6.3. Pre-prompt ranking
python preprompt_ranker.py
Same as the model ranking, but you will have to first input the name of the model you prefer and the system prompt you prefer.
A csv file will be created in the evaluation folder.
You can look at the notebook to see the statistical analysis of the evaluation results.
Jupyter Notebook
97.4%
Python
2.6%