Skip to content

Commit

Permalink
update README + run shell
Browse files Browse the repository at this point in the history
  • Loading branch information
LVH-Tony committed Feb 22, 2024
1 parent d1786c8 commit 64c7eee
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 45 deletions.
96 changes: 55 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ FINE TUNED **MINER** (`WIP`) REQUIREMENTS
- Python 3.9 or 3.10
- CUDA 12.0 or higher

**OPENAI MINER** REQUIREMENTS

- Python 3.8, 3.9 or 3.10

# Tools

Currently, the tooling stack includes `mathgenerator`, `OpenAI`, `HuggingFace`, `LangChain`, and `WandB`
Expand Down Expand Up @@ -86,7 +90,15 @@ python -m pip install -r requirements.txt && python -m pip install -e .

---

# Running Validators
# Running Validators and Miners

*Disclaimer:* We encourage miners to use testnet as this gives you a risk-free playground before running on mainnet. If you require test tao, please reach out to <steffen@opentensor.dev>

Prior to running a miner or validator, you must [create a wallet](https://github.com/opentensor/docs/blob/main/reference/btcli.md) and [register the wallet to a netuid](https://github.com/opentensor/docs/blob/main/subnetworks/registration.md). Once you have done so, you can run the miner and validator with the following commands.

---

## Running Validators

1. Install this repository, you can do so by following the steps outlined in [the installation section](#installation).
2. Install [Weights and Biases](https://docs.wandb.ai/quickstart) and run `wandb login` within this repository. This will initialize Weights and Biases, enabling you to view KPIs and Metrics on your validator. (Strongly recommended to help the network improve from data sharing)
Expand All @@ -109,20 +121,9 @@ python -m pip install -r requirements.txt && python -m pip install -e .
pm2 start run.sh --name s1_validator_autoupdate -- --wallet.name <your-wallet-name> --wallet.hotkey <your-wallet-hot-key>
```

---
The `run.sh` script will automatically pull the latest updates from the repository and restart the validator. This is useful for keeping your validator up to date with the latest changes.

# Miners

1. AIT PAL `Work In Progress - Not yet public`
2. [OpenAI](https://platform.openai.com/docs/introduction) (GPT variants)

---

# Running on Testnet

We encourage miners to use testnet as this gives you a risk-free playground before running on mainnet. If you require test tao, please reach out to <steffen@opentensor.dev>

Prior to running a miner or validator, you must [create a wallet](https://github.com/opentensor/docs/blob/main/reference/btcli.md) and [register the wallet to a netuid](https://github.com/opentensor/docs/blob/main/subnetworks/registration.md). Once you have done so, you can run the miner and validator with the following commands.
5. **Running the Validator:**

```bash
python neurons/validator.py \
Expand All @@ -132,52 +133,63 @@ python neurons/validator.py \
--wallet.name <your validator wallet> \
--wallet.hotkey <your validator hotkey> \
--logging.debug

```

*NOTE: Your wallet and wallet's hotkey must be created using the bittensor-cli and registered to the netuid 78 (our testnet uid). Additionally, you can run the validator in trace mode by using `--logging.trace` instead of `--logging.debug`*
*NOTE: Your wallet and wallet's hotkey must be created using the bittensor-cli and registered to the netuid 78 (our testnet uid). Additionally, you can run the validator in trace mode by using `--logging.trace` instead of `--logging.debug`*

If you want to run our base openai miners, you must first install the required dependencies by:
---

```bash
pip install -r neurons/miners/openai/requirements.txt
```
## Running Miners

Then you will need to have your include your OpenAI API key into .env and you can do so by:
### Base Models

```bash
echo 'OPENAI_API_KEY=your_api_key_here' >> .env
```
1. AIT Custom API `Work In Progress - Not yet public`
2. [OpenAI](https://platform.openai.com/docs/introduction) (GPT variants)

Now, go ahead and start the miner:
### OpenAI Miner

```bash
# To run the miner
python neurons/miners/openai/miner.py \
--netuid 78 \
--subtensor.network test \
--wallet.name <your miner wallet> \
--wallet.hotkey <your miner hotkey> \
--neuron.model_id gpt \
--neuron.max_tokens 1024 \
--neuron.temperature 0.9 \
--logging.debug
```
1. Install the required dependencies by:

*NOTE: Your wallet and wallet's hotkey must be created using the bittensor-cli and registered to the netuid 78 (our testnet uid). Additionally, you can run the validator in trace mode by using `--logging.trace` instead of `--logging.debug`*
```bash
pip install -r neurons/miners/openai/requirements.txt
```

*- The `--neuron.model_id` flag is used to specify the model you want to use. The default value is `gpt3.5-turbo`*
2. Include your OpenAI API key into .env and you can do so by:

*- The `--neuron.max_tokens` flag is used to specify the maximum number of tokens the model can generate. The default value is `256`*
```bash
echo 'OPENAI_API_KEY=your_api_key_here' >> .env
```

*- The `--neuron.temperature` flag is used to specify the temperature of the model. The default value is `0.7`*
3. Start the miner:

```bash
python neurons/miners/openai/miner.py \
--netuid 78 \
--subtensor.network test \
--wallet.name <your miner wallet> \
--wallet.hotkey <your miner hotkey> \
--neuron.model_id gpt \
--neuron.max_tokens 1024 \
--neuron.temperature 0.9 \
--logging.debug
```

*NOTE: Your wallet and wallet's hotkey must be created using the bittensor-cli and registered to the netuid 78 (our testnet uid). Additionally, you can run the validator in trace mode by using `--logging.trace` instead of `--logging.debug`*

*- The `--neuron.model_id` flag is used to specify the model you want to use. The default value is `gpt3.5-turbo`*

*- The `--neuron.max_tokens` flag is used to specify the maximum number of tokens the model can generate. The default value is `256`*

*- The `--neuron.temperature` flag is used to specify the temperature of the model. The default value is `0.7`*

---

# Real-time monitoring with wandb integration

Check out real-time public logging by looking at the project [here](https://wandb.ai/ait-ai/einstein-ait)

---

## License

This repository is licensed under the MIT License.
Expand All @@ -200,3 +212,5 @@ This repository is licensed under the MIT License.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
```

---
2 changes: 1 addition & 1 deletion einstein/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the version of the template module.
__version__ = "1.0.4"
__version__ = "1.0.1"
version_split = __version__.split(".")
__spec_version__ = (
(10000 * int(version_split[0]))
Expand Down
2 changes: 1 addition & 1 deletion min_compute.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '1.0.4' # Update this version key as needed to match your release version
version: '1.0.1' # Update this version key as needed to match your release version

compute_spec:

Expand Down
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ script="neurons/validator.py"
autoRunLoc=$(readlink -f "$0")
proc_name="s1_validator_main_process"
args=()
version_location="./einstein-ait/__init__.py"
version_location="./einstein/__init__.py"
version="__version__"

old_args=$@
Expand Down Expand Up @@ -229,7 +229,7 @@ if [ "$?" -eq 1 ]; then
if [ -d "./.git" ]; then

# check value on github remotely
latest_version=$(check_variable_value_on_github "LVH-Tony/einstein-ait" "einstein-ait/__init__.py" "__version__ ")
latest_version=$(check_variable_value_on_github "ait-protocol/einstein-ait-prod" "einstein/__init__.py" "__version__ ")

# If the file has been updated
if version_less_than $current_version $latest_version; then
Expand Down

0 comments on commit 64c7eee

Please sign in to comment.