for those that like to keep the SF nn file current..

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

for those that like to keep the SF nn file current..

Post by MikeB »

deep down inside, I am very lazy and hate nothing more than mundane tasks ...

Code: Select all

#!/bin/bash

# name this file "getnet.sh" or whatever you preferred
# by MichaelB7  08/12/20
# A little script to update to current SF net and to rename net file to "eval.bin"
# designed to be run from thr src folder , modify as you wish.
# This script is covered by the usual disclaimers, meaning that I am not possibly
# responsible, finanacially or otherwise, for anything that may possibly go
# wrong. There is absolutley no implied warranty, merchantability
# or fitness for any particular purpose whatsover.


cd ../  ## move up a directory, modify to your own preference
wget https://github.com/official-stockfish/Stockfish/raw/master/src/ucioption.cpp
sha256nn="$(grep EvalFile ucioption.cpp | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/')"
echo "sha256nn = $sha256nn"
binurl=" https://tests.stockfishchess.org/api/nn/$sha256nn"

##renames nnue file to eval.bin , modify "eval.bin" to your own preference
wgetnet="wget -O eval.bin"   

## pulls the most recent and latest officical NN from the SF Github repository  
$wgetnet $binurl  
rm ucioption.cpp   ## no lonnger needed.     
sleep 1  ##  need to wait 1 second, before moving file or might error as being busy 

# I like to keep it in my SF build folder, modify to your own preference
mv eval.bin src/  
cd - ## return to previous directory
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: for those that like to keep the SF nn file current..

Post by MikeB »

Just noticed there is new PR from Sergio , this script will only pull the latest net once his PR is approved , which should be soon.
Image