Spaces:
Paused
Paused
| import gradio as gr | |
| import os | |
| import chess | |
| import chess.engine | |
| import stat | |
| def eval(fenstring): | |
| output = "" | |
| os.chmod("./stash-36.0-linux-x86_64-popcnt",0o0777) | |
| engine = chess.engine.SimpleEngine.popen_uci("./stash-36.0-linux-x86_64-popcnt") | |
| # Score: PovScore(Cp(+20), WHITE) | |
| board = chess.Board(fenstring) | |
| info = engine.analyse(board, chess.engine.Limit(depth=1),multipv=3) | |
| # Score: PovScore(Mate(+1), WHITE) | |
| engine.quit() | |
| return info | |
| iface = gr.Interface(fn=eval, title="stash-1",inputs="text", outputs="text") | |
| iface.queue(api_open=True) | |
| iface.launch() |