Skip to content

Commit

Permalink
fix torch typehint on some neurons BT-1329 (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild authored Jul 26, 2023
1 parent 56cda18 commit a9954b6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion neurons/text/prompting/miners/AI21/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import argparse
import bittensor
from torch import FloatTensor

from typing import List, Dict
from langchain.llms import AI21
Expand Down Expand Up @@ -57,7 +58,7 @@ def __init__(self):
bittensor.logging.info("Model loaded!")

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down
3 changes: 2 additions & 1 deletion neurons/text/prompting/miners/AlephAlpha/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import bittensor
from rich import print
from typing import List, Dict
from torch import FloatTensor

from langchain.llms import AlephAlpha

Expand Down Expand Up @@ -87,7 +88,7 @@ def __init__(self):
)

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down
3 changes: 2 additions & 1 deletion neurons/text/prompting/miners/cerebras/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import bittensor
from typing import List, Dict
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
from torch import FloatTensor


class CerebrasMiner(bittensor.BasePromptingMiner):
Expand Down Expand Up @@ -83,7 +84,7 @@ def __init__(self):
)

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down
3 changes: 2 additions & 1 deletion neurons/text/prompting/miners/cohere/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import bittensor
from typing import List, Dict
from langchain.llms import Cohere
from torch import FloatTensor


class CohereMiner(bittensor.BasePromptingMiner):
Expand Down Expand Up @@ -108,7 +109,7 @@ def __init__(self):
)

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down
4 changes: 3 additions & 1 deletion neurons/text/prompting/miners/gooseai/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import argparse
import bittensor
from typing import List, Dict, Any, Optional
from torch import FloatTensor

from langchain.llms import GooseAI


Expand Down Expand Up @@ -111,7 +113,7 @@ def __init__(self):
)

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down
3 changes: 2 additions & 1 deletion neurons/text/prompting/miners/gpt4all/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import argparse
import bittensor
from typing import List, Dict
from torch import FloatTensor
from langchain.llms import GPT4All


Expand Down Expand Up @@ -164,7 +165,7 @@ def __init__(self):
)

def backward(
self, messages: List[Dict[str, str]], response: str, rewards: torch.FloatTensor
self, messages: List[Dict[str, str]], response: str, rewards: FloatTensor
) -> str:
pass

Expand Down

0 comments on commit a9954b6

Please sign in to comment.