From db93595dd316185e27c629b3cc1ee830754e39e1 Mon Sep 17 00:00:00 2001 From: Jackalgirl <88459050+Jackalgirl@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:04:11 -0600 Subject: [PATCH 1/6] Update line 54: wallet to wallet_ss58 (#61) * version bug fixes * v2.1.1 * Update line 54: wallet to wallet_ss58 This will hopefully solve some issues where miners are not getting requests, as per cocofreddie's fix in the Opentensor Discord, here: https://discord.com/channels/799672011265015819/1161764867166961704/1169952256536354867 --------- Co-authored-by: p-ferreira <38992619+p-ferreira@users.noreply.github.com> Co-authored-by: Eugene Co-authored-by: Eugene-hu <85906264+Eugene-hu@users.noreply.github.com> --- prompting/baseminer/run.py | 2 +- prompting/validators/__init__.py | 2 +- run.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prompting/baseminer/run.py b/prompting/baseminer/run.py index 3327a09..1c360ec 100644 --- a/prompting/baseminer/run.py +++ b/prompting/baseminer/run.py @@ -51,7 +51,7 @@ def run(self): # --- Check for registration. if not self.subtensor.is_hotkey_registered( netuid=self.config.netuid, - hotkey=self.wallet.hotkey.ss58_address, + hotkey_ss58=self.wallet.hotkey.ss58_address, ): bt.logging.error( f"Wallet: {self.wallet} is not registered on netuid {self.config.netuid}" diff --git a/prompting/validators/__init__.py b/prompting/validators/__init__.py index 24575cc..6855712 100644 --- a/prompting/validators/__init__.py +++ b/prompting/validators/__init__.py @@ -27,7 +27,7 @@ from . import event from . import dataset -__version__ = "2.1.0" +__version__ = "2.1.1" version_split = __version__.split(".") __spec_version__ = ( (1000 * int(version_split[0])) diff --git a/run.sh b/run.sh index 6519cc1..1d46108 100755 --- a/run.sh +++ b/run.sh @@ -5,7 +5,7 @@ script="neurons/validators/validator.py" autoRunLoc=$(readlink -f "$0") proc_name="text_prompt_validators_main_process" args=() -version_location="./prompting/__init__.py" +version_location="./prompting/validators/__init__.py" version="__version__" old_args=$@ @@ -229,7 +229,7 @@ if [ "$?" -eq 1 ]; then if [ -d "./.git" ]; then # check value on github remotely - latest_version=$(check_variable_value_on_github "opentensor/validators" "openvalidators/__init__.py" "__version__ ") + latest_version=$(check_variable_value_on_github "opentensor/text-prompting" "prompting/validators/__init__.py" "__version__ ") # If the file has been updated if version_less_than $current_version $latest_version; then From a5a61d4d6d0ff064910178b2817edb7bd83165d4 Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Wed, 8 Nov 2023 16:56:33 +0000 Subject: [PATCH 2/6] update reward config weights --- prompting/validators/reward/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prompting/validators/reward/config.py b/prompting/validators/reward/config.py index ecf9160..7583924 100644 --- a/prompting/validators/reward/config.py +++ b/prompting/validators/reward/config.py @@ -39,8 +39,8 @@ class DefaultRewardFrameworkConfig: Note: All the weights should add up to 1.0. """ - dpo_model_weight: float = 0.425 - rlhf_model_weight: float = 0.15 - reciprocate_model_weight: float = 0.425 + dpo_model_weight: float = 0.6 + rlhf_model_weight: float = 0 + reciprocate_model_weight: float = 0.4 dahoas_model_weight: float = 0 prompt_model_weight: float = 0 From a699f9ef19dc6546722981ca1a986501caafbd6b Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Wed, 8 Nov 2023 16:56:47 +0000 Subject: [PATCH 3/6] modify flow of conversation --- prompting/validators/forward.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/prompting/validators/forward.py b/prompting/validators/forward.py index 8dfcd1e..dca0b6c 100644 --- a/prompting/validators/forward.py +++ b/prompting/validators/forward.py @@ -241,11 +241,11 @@ async def forward(self): best_summary = summarization_event["best"] exclude = summarization_event["uids"] - prompt_context = "### SUMMARY CONTEXT:\n" + best_summary + best_summary_context = "### SUMMARY CONTEXT:\n" + best_summary for k in range(self.config.neuron.num_followup_steps): # Get a followup question, given the summarized context. - qg_task = create_qg_task(base_text=prompt_context, index=k) + qg_task = create_qg_task(base_text=best_summary_context, index=k) qg_event = await run_step( self, task=qg_task, @@ -257,9 +257,9 @@ async def forward(self): # Adds the best question to the prompt context. best_question = qg_event["best"] - prompt_context += f"\n### QUESTION {k}:\n{best_question}" + best_question_prompt = best_summary_context + f"\n### QUESTION {k}:\n{best_question}" - qa_task = create_qa_task(prompt_context, index=k) + qa_task = create_qa_task(best_question_prompt, index=k) qa_event = await run_step( self, task=qa_task, @@ -267,10 +267,7 @@ async def forward(self): timeout=self.config.neuron.answer_timeout, exclude=exclude, ) - - best_answer = qa_event["best"] - prompt_context += f"\n### ANSWER {k}:\n{best_answer}" - + exclude += qa_event["uids"] self.blacklist.question_blacklist.append(qg_event["best"]) From becb73e222cf014a3ae3f730af96607f4521ae0c Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Wed, 8 Nov 2023 16:57:15 +0000 Subject: [PATCH 4/6] update answer task prompt --- prompting/validators/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prompting/validators/tasks.py b/prompting/validators/tasks.py index e161d7b..176f618 100644 --- a/prompting/validators/tasks.py +++ b/prompting/validators/tasks.py @@ -100,9 +100,10 @@ def compose_prompt(self) -> str: criteria_bullet_points_str = "\n".join(criteria_bullet_points) prompt_template = textwrap.dedent( - """\ + """\ Read the preceding context delimited with triple backticks carefully. - Your task is to provide a step-by-step answer to the last question found in the text, elaborating on your thought process: + Your task is to provide a a clear and direct answer to the last question found in the text. + Maintain an objective tone by sticking to factual information and logical deductions without personal opinions or emotional language: '''{base_text}''' The following criteria must be respected: From 340b2a0e42909f0d560fda4e7ece49465a26d1b2 Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Wed, 8 Nov 2023 17:28:01 +0000 Subject: [PATCH 5/6] run black in repo --- prompting/validators/forward.py | 6 ++++-- prompting/validators/tasks.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/prompting/validators/forward.py b/prompting/validators/forward.py index dca0b6c..5ea5c94 100644 --- a/prompting/validators/forward.py +++ b/prompting/validators/forward.py @@ -257,7 +257,9 @@ async def forward(self): # Adds the best question to the prompt context. best_question = qg_event["best"] - best_question_prompt = best_summary_context + f"\n### QUESTION {k}:\n{best_question}" + best_question_prompt = ( + best_summary_context + f"\n### QUESTION {k}:\n{best_question}" + ) qa_task = create_qa_task(best_question_prompt, index=k) qa_event = await run_step( @@ -267,7 +269,7 @@ async def forward(self): timeout=self.config.neuron.answer_timeout, exclude=exclude, ) - + exclude += qa_event["uids"] self.blacklist.question_blacklist.append(qg_event["best"]) diff --git a/prompting/validators/tasks.py b/prompting/validators/tasks.py index 176f618..5469a11 100644 --- a/prompting/validators/tasks.py +++ b/prompting/validators/tasks.py @@ -100,7 +100,7 @@ def compose_prompt(self) -> str: criteria_bullet_points_str = "\n".join(criteria_bullet_points) prompt_template = textwrap.dedent( - """\ + """\ Read the preceding context delimited with triple backticks carefully. Your task is to provide a a clear and direct answer to the last question found in the text. Maintain an objective tone by sticking to factual information and logical deductions without personal opinions or emotional language: From 7297b914ccf9649bcb7e7343c154d98caf2a2f32 Mon Sep 17 00:00:00 2001 From: p-ferreira Date: Wed, 8 Nov 2023 18:16:56 +0000 Subject: [PATCH 6/6] remove extra 'a' from answer prompt --- prompting/validators/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prompting/validators/tasks.py b/prompting/validators/tasks.py index 5469a11..ccf63de 100644 --- a/prompting/validators/tasks.py +++ b/prompting/validators/tasks.py @@ -102,7 +102,7 @@ def compose_prompt(self) -> str: prompt_template = textwrap.dedent( """\ Read the preceding context delimited with triple backticks carefully. - Your task is to provide a a clear and direct answer to the last question found in the text. + Your task is to provide a clear and direct answer to the last question found in the text. Maintain an objective tone by sticking to factual information and logical deductions without personal opinions or emotional language: '''{base_text}'''