Skip to content

Commit bff3d3c

Browse files
author
richwardle
committed
Add Task to headers
1 parent 5225ff4 commit bff3d3c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

neurons/validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ async def collect_responses(self, task: BaseTextTask) -> DendriteResponseEvent |
140140
return
141141

142142

143-
body = {"seed": task.seed, "model": task.llm_model_id, "messages": [{'role': 'user', 'content': task.query},]}
143+
body = {"seed": task.seed, "task": task.__class__.__name__, "model": task.llm_model_id, "messages": [{'role': 'user', 'content': task.query},]}
144144
body_bytes = json.dumps(body).encode("utf-8")
145-
stream_results = await query_miners(task.__class__.__name__, uids, body_bytes)
145+
stream_results = await query_miners(uids, body_bytes)
146146

147147
log_stream_results(stream_results)
148148

prompting/base/epistula.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ async def add_headers(request: httpx.Request):
8585

8686
return add_headers
8787

88-
async def query_miners(task, uids, body):
88+
async def query_miners(uids, body):
8989
try:
9090
tasks = []
9191
for uid in uids:
9292
tasks.append(
9393
asyncio.create_task(
9494
handle_inference(
95-
settings.METAGRAPH, settings.WALLET, task, body, uid,
95+
settings.METAGRAPH, settings.WALLET, body, uid,
9696
)
9797
)
9898
)
@@ -149,7 +149,6 @@ async def handle_availability(
149149
async def handle_inference(
150150
metagraph: "bt.NonTorchMetagraph",
151151
wallet: "bt.wallet",
152-
task: str,
153152
body: Dict[str, Any],
154153
uid: int,
155154
) -> SynapseStreamResult:

0 commit comments

Comments
 (0)