swap1411 commited on
Commit
b91b660
·
verified ·
1 Parent(s): 74e1f80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -17
app.py CHANGED
@@ -4,7 +4,6 @@ from stockfish import Stockfish
4
  import os
5
  import numpy as np
6
  import streamlit as st
7
- import requests
8
 
9
 
10
  # Constants
@@ -70,21 +69,6 @@ def predict_next_move(fen, stockfish):
70
  best_move = stockfish.get_best_move()
71
  ans = transform_string(best_move)
72
  return f"The predicted next move is: {ans}" if best_move else "No valid move found (checkmate/stalemate)."
73
-
74
-
75
-
76
- # def download_stockfish():
77
- # url = "https://drive.google.com/file/d/18pkwBVc13fgKP3LzrTHE4yzhjyGJexlR/view?usp=sharing" # Replace with the actual link
78
- # file_name = "stockfish-windows-x86-64-avx2.exe"
79
-
80
- # if not os.path.exists(file_name):
81
- # print(f"Downloading {file_name}...")
82
- # response = requests.get(url, stream=True)
83
- # with open(file_name, "wb") as file:
84
- # for chunk in response.iter_content(chunk_size=1024):
85
- # if chunk:
86
- # file.write(chunk)
87
- # print(f"{file_name} downloaded successfully.")
88
 
89
  def process_image(image_path):
90
  # Ensure output directory exists
@@ -172,7 +156,6 @@ def transform_string(input_str):
172
 
173
  # Streamlit app
174
  def main():
175
- # download_stockfish()
176
  st.title("Chessboard Position Detection and Move Prediction")
177
 
178
  os.chmod("/home/user/app/stockfish-ubuntu-x86-64-sse41-popcnt", 0o755)
 
4
  import os
5
  import numpy as np
6
  import streamlit as st
 
7
 
8
 
9
  # Constants
 
69
  best_move = stockfish.get_best_move()
70
  ans = transform_string(best_move)
71
  return f"The predicted next move is: {ans}" if best_move else "No valid move found (checkmate/stalemate)."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  def process_image(image_path):
74
  # Ensure output directory exists
 
156
 
157
  # Streamlit app
158
  def main():
 
159
  st.title("Chessboard Position Detection and Move Prediction")
160
 
161
  os.chmod("/home/user/app/stockfish-ubuntu-x86-64-sse41-popcnt", 0o755)