diff --git a/common/generative_configs/generative_config_long.json b/common/generative_configs/generative_config_long.json new file mode 100644 index 0000000000..b85abdab8b --- /dev/null +++ b/common/generative_configs/generative_config_long.json @@ -0,0 +1,8 @@ +{ + "max_new_tokens": 256, + "min_new_tokens": 8, + "top_p": 0.9, + "temperature": 0.9, + "do_sample": true, + "num_return_sequences": 2 +} \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/generative_configs/default_generative_config.json b/response_selectors/llm_based_response_selector/generative_configs/default_generative_config.json deleted file mode 100644 index 1edf84f186..0000000000 --- a/response_selectors/llm_based_response_selector/generative_configs/default_generative_config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "max_length": 60, - "min_length": 8, - "top_p": 0.9, - "temperature": 0.9, - "do_sample": true, - "num_return_sequences": 2 -} \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/generative_configs/openai-chatgpt.json b/response_selectors/llm_based_response_selector/generative_configs/openai-chatgpt.json deleted file mode 100644 index 107e944b80..0000000000 --- a/response_selectors/llm_based_response_selector/generative_configs/openai-chatgpt.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "max_tokens": 64, - "temperature": 0.4, - "top_p": 1.0, - "frequency_penalty": 0, - "presence_penalty": 0 -} \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003-long.json b/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003-long.json deleted file mode 100644 index a109e4db88..0000000000 --- a/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003-long.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "max_tokens": 128, - "temperature": 0.4, - "top_p": 1.0, - "frequency_penalty": 0, - "presence_penalty": 0 -} \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003.json b/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003.json deleted file mode 100644 index 107e944b80..0000000000 --- a/response_selectors/llm_based_response_selector/generative_configs/openai-text-davinci-003.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "max_tokens": 64, - "temperature": 0.4, - "top_p": 1.0, - "frequency_penalty": 0, - "presence_penalty": 0 -} \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/server.py b/response_selectors/llm_based_response_selector/server.py index bc7fc64012..ab30ca81b5 100644 --- a/response_selectors/llm_based_response_selector/server.py +++ b/response_selectors/llm_based_response_selector/server.py @@ -58,7 +58,10 @@ def select_response_by_scores(hypotheses, scores): def select_response(dialog_context, hypotheses, human_uttr_attributes): try: - curr_prompt = PROMPT + "\nHypotheses:\n" + "\n".join([f'"{hyp["text"]}"' for hyp in hypotheses]) + if "transformers" in GENERATIVE_SERVICE_URL: + curr_prompt = "Hypotheses:\n" + "\n".join([f'"{hyp["text"]}"' for hyp in hypotheses]) + "\n" + PROMPT + else: + curr_prompt = PROMPT + "\nHypotheses:\n" + "\n".join([f'"{hyp["text"]}"' for hyp in hypotheses]) logger.info(f"llm_based_response_selector sends dialog context to llm:\n`{dialog_context}`") logger.info(f"llm_based_response_selector sends prompt to llm:\n`{curr_prompt}`")