Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
# https://www.stockfish.online/docs.php (API)
|
| 4 |
# https://www.stockfish.online/ (FEN to image)
|
| 5 |
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import gradio.utils, requests
|
| 8 |
from typing import Optional, List, Dict, Any
|
|
@@ -18,11 +19,11 @@ def position_evaluation(fen):
|
|
| 18 |
Returns:
|
| 19 |
tuple: (result, error) - Best move with continuation in UCI notation
|
| 20 |
"""
|
| 21 |
-
is_valid,
|
| 22 |
|
| 23 |
if not is_valid:
|
| 24 |
-
gr.Warning(f"Invalid input: {
|
| 25 |
-
return None,
|
| 26 |
|
| 27 |
print("")
|
| 28 |
|
|
|
|
| 3 |
# https://www.stockfish.online/docs.php (API)
|
| 4 |
# https://www.stockfish.online/ (FEN to image)
|
| 5 |
|
| 6 |
+
import re
|
| 7 |
import gradio as gr
|
| 8 |
import gradio.utils, requests
|
| 9 |
from typing import Optional, List, Dict, Any
|
|
|
|
| 19 |
Returns:
|
| 20 |
tuple: (result, error) - Best move with continuation in UCI notation
|
| 21 |
"""
|
| 22 |
+
is_valid, msg = validate_input(fen)
|
| 23 |
|
| 24 |
if not is_valid:
|
| 25 |
+
gr.Warning(f"Invalid input: {msg}")
|
| 26 |
+
return None, msg
|
| 27 |
|
| 28 |
print("")
|
| 29 |
|