This commit updates the `app.py` file to set a default model name if the `HF_MODEL_NAME` environment variable is not set. The default model name is `meta-llama/Meta-Llama-3-8B-Instruct`. This change ensures that the application uses a valid model name even if the environment variable is not provided.
This commit adds the necessary environment variables for the Hugging Face token and model name in the `docker-compose.yml` file. The `HF_TOKEN` environment variable is used to store the Hugging Face API token, which can be obtained by signing up on Hugging Face and creating a new API token. The `HF_MODEL_NAME` environment variable is optional and allows specifying the model name from Hugging Face. If not set, the default model `meta-llama/Meta-Llama-3-8B-Instruct` will be used.
The code changes in `app.py` update the URL for validating the secret key. The previous URL was using the endpoint `/api/code-repository/is-valid/{secretKey}`, and it has been changed to `/api/copilot-code-repository/is-valid/{secretKey}`. This change ensures that the correct endpoint is used for validating the secret key in the OneUptime service.
The code changes in `app.py` add a new parameter `max_new_tokens` to the `job` function. This parameter allows the maximum number of new tokens to be specified when calling the function. This change enhances the flexibility and control of the `job` function by allowing the maximum number of new tokens to be adjusted as needed.
This refactor changes the code in CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts to use an array of messages instead of a single prompt. Each message in the array contains the content and role of the prompt, improving flexibility and readability.
The directory name for Llama Models has been updated from "Llama/Models" to "LLM/Models". This change ensures consistency and aligns with the updated file paths in the codebase.