From d39c7d963586937427829448019098b16439734c Mon Sep 17 00:00:00 2001 From: juanroesel Date: Mon, 13 May 2024 16:18:49 -0700 Subject: [PATCH] Removing previous function to detect ai-service based off system message --- llama_cpp/_utils.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/llama_cpp/_utils.py b/llama_cpp/_utils.py index dbdc3179f..db5b6eb68 100644 --- a/llama_cpp/_utils.py +++ b/llama_cpp/_utils.py @@ -3,7 +3,7 @@ import psutil import subprocess -from typing import Any, Dict, List, Tuple +from typing import Any, Dict, List, Tuple, Union # Avoid "LookupError: unknown encoding: ascii" when open() called in a destructor outnull_file = open(os.devnull, "w") @@ -123,25 +123,3 @@ def get_gpu_general_info() -> Tuple[float, float, float]: except (subprocess.CalledProcessError, FileNotFoundError): pass return 0.0, 0.0, 0.0 - -def infer_service_from_prompt(prompt: str | List[str]): - """ - Infer the service for which a completion request is sent based on the prompt. - """ - LABEL_SUGGESTIONS_TASK = "Your task is to select the most relevant labels for a GitHub issue title from a list of labels provided." - ACCEPTANCE_CRITERIA_TASK = "Your task is to write the acceptance criteria for a GitHub issue." - SPRINT_REVIEW_TASK = "You are helping me prepare a sprint review." - - if isinstance(prompt, list): - prompt = " ".join(prompt) - - if LABEL_SUGGESTIONS_TASK in prompt: - return "label-suggestions" - - elif ACCEPTANCE_CRITERIA_TASK in prompt: - return "acceptance-criteria" - - elif SPRINT_REVIEW_TASK in prompt: - return "sprint-review" - - return "not-specified"