File size: 588 Bytes
8fbeb2f
3fb4645
 
 
 
8fbeb2f
 
 
3fb4645
 
337a17f
 
3fb4645
8fbeb2f
3fb4645
8fbeb2f
3fb4645
 
31c3c01
3fb4645
 
 
 
 
 
39be762
ca80276
3fb4645
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
import os
import chess
import chess.engine
import stat



def eval(fenstring):
    output = ""
    os.chmod("./Lizard-11_2-linux",0o0777)
    engine = chess.engine.SimpleEngine.popen_uci("./Lizard-11_2-linux")
    

    # 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="Lizard-1",inputs="text", outputs="text")
iface.queue(api_open=True)
iface.launch()