Skip to content

adanothe/allora-testnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Deploying a Hugging Face Model as a Worker Node on the Allora Network

This guide provides a step-by-step process to deploy a Hugging Face model as a Worker Node within the Allora Network. By following these instructions, you will be able to integrate and run models from Hugging Face, contributing to the Allora decentralized machine intelligence ecosystem.

See complete walkthrough and instructions here.

Allora Resource

System Requirements

Component Minimum Requirements
Operating System Windows, macOS, or Linux
CPU 1/2 core minimum
RAM 2 to 4 GB
Storage 5 GB SSD or NVMe

Server Prerequisites

  • Update and Upgrade Server: Ensure your server is up to date.

    sudo apt update && sudo apt upgrade -y
  • Install Required Packages: Install the necessary dependencies.

    sudo apt install -y ca-certificates zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev curl git wget make jq build-essential pkg-config lsb-release libssl-dev libreadline-dev libffi-dev gcc screen unzip lz4
  • Install Docker: Use the following command to install Docker.

    curl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/Dedenwrg/dependencies/main/docker/docker.sh | sudo sh
  • Install Go: Remove any existing Go installation and install the latest version.

    sudo rm -rf /usr/local/go
    curl -L https://go.dev/dl/go1.22.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
    echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
    echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> $HOME/.bash_profile
    source $HOME/.bash_profile
    go version
  • Install Python & Pip: Install Python 3 and pip.

    sudo apt install python3
    python3 --version
    
    sudo apt install python3-pip
    pip3 --version

Install Allorad Wallet

  • Clone the Repository and Build the Wallet:

    git clone https://github.com/allora-network/allora-chain.git
    cd allora-chain && make all
    allorad version

Create a Wallet and Obtain Test Tokens

  • Create a Wallet: Generate a new wallet and save the mnemonic phrase.

    allorad keys add wallet
  • Import to Keplr: Import the mnemonic phrase into Keplr.

  • Connect to the Allora Dashboard: Use the Allora Dashboard with Keplr.

  • Add Allora Chain to Keplr: Use this link to add the Allora chain to Keplr.

  • Get Faucet Tokens: Obtain test tokens from the faucet.

Install & Run Worker

  • Clone the Worker Repository:

    cd $HOME
    git clone https://github.com/allora-network/allora-huggingface-walkthrough
    cd allora-huggingface-walkthrough
  • Prepare the Worker Directory:

    mkdir -p worker-data
    chmod -R 777 worker-data
  • Configure Seed Phrase: Replace SeedPhrase with your wallet seed phrase.

    curl -O https://raw.githubusercontent.com/adanothe/allora-testnet/main/config.json
    SEED_PHRASE="SeedPhrase"
    sed -i "s/\"addressRestoreMnemonic\": \"[^\"]*\"/\"addressRestoreMnemonic\": \"$SEED_PHRASE\"/" config.json
  • Create Coingecko API Key:

    • Create a demo account on Coingecko.

    • Replace APIKEY with your Coingecko API key.

    COINGECKO_API_KEY="APIKEY"
    sed -i "s/<Your Coingecko API key>/$COINGECKO_API_KEY/" app.py
  • Run Huggingface Worker:

    chmod +x init.config
    ./init.config
    
    docker compose up -d --build
  • View Logs:

    • Node Logs: Add the following to your bash profile to easily view logs:
      echo 'export WORKER_COMPOSE="$HOME/allora-huggingface-walkthrough/docker-compose.yaml"' >> ~/.bashrc
      source ~/.bashrc
      To view logs:
      docker compose logs -f --tail=100

Testing Inference

To test the inference model only:

  • . Send requests to the inference model. For example, request ETH price inferences:

    curl http://127.0.0.1:8000/inference/ETH

    Expected response:

    {"value":"2564.021586281073"}

Points & Leaderboard

You'll receive points on the Allora Dashboard within the next few hours.

Follow Adanothe

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors