Spaces:
Paused
Paused
Commit ·
30af058
1
Parent(s): 69dd8c0
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,32 +1,10 @@
|
|
| 1 |
-
#from stockfish import Stockfish
|
| 2 |
-
|
| 3 |
-
#stockfish = Stockfish(path="./stockfish_14_x64_popcnt")/
|
| 4 |
import gradio as gr
|
| 5 |
-
import os
|
| 6 |
-
import chess
|
| 7 |
-
import chess.engine
|
| 8 |
-
import stat
|
| 9 |
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
def eval(fenstring):
|
| 13 |
-
output = ""
|
| 14 |
-
os.chmod("./stockfish_14_x64_popcnt",0o0777)
|
| 15 |
-
engine = chess.engine.SimpleEngine.popen_uci("./stockfish_14_x64_popcnt")
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
info = engine.analyse(board, chess.engine.Limit(depth=5),multipv=3)
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
# Score: PovScore(Mate(+1), WHITE)
|
| 26 |
-
|
| 27 |
-
engine.quit()
|
| 28 |
-
return info
|
| 29 |
-
iface = gr.Interface(fn=eval, title="Stockfish chessboard eval",
|
| 30 |
-
description="Stockfish 14 chess evaluation using pychess engine component. Enter in fen string to get the board eval and the 3 best moves with continuations\
|
| 31 |
-
Stockfish 15 would not execute in huggingface due to glibc", inputs="text", outputs="text")
|
| 32 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
+
def greet(name):
|
| 5 |
+
return "Hello " + name
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 9 |
|
| 10 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|