Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import logging
|
| 3 |
import gradio as gr
|
|
@@ -109,26 +125,6 @@ def main():
|
|
| 109 |
demo.launch(share=True, max_threads=32)
|
| 110 |
|
| 111 |
if __name__ == "__main__":
|
| 112 |
-
import os
|
| 113 |
-
import subprocess
|
| 114 |
-
import multiprocessing
|
| 115 |
-
|
| 116 |
-
# Install BrowserGym dependencies before running the main application
|
| 117 |
-
def install_browsergym():
|
| 118 |
-
try:
|
| 119 |
-
print("Installing BrowserGym dependencies...")
|
| 120 |
-
subprocess.run("cd BrowserGym && make install", shell=True, check=True)
|
| 121 |
-
print("BrowserGym installation completed successfully")
|
| 122 |
-
except subprocess.CalledProcessError as e:
|
| 123 |
-
print(f"Error installing BrowserGym: {e}")
|
| 124 |
-
raise
|
| 125 |
-
|
| 126 |
-
# Run the installation before starting the application
|
| 127 |
-
if os.path.exists("BrowserGym"):
|
| 128 |
-
install_browsergym()
|
| 129 |
-
else:
|
| 130 |
-
print("BrowserGym directory not found. Skipping installation.")
|
| 131 |
-
|
| 132 |
# Add support for multiprocessing on Windows
|
| 133 |
multiprocessing.freeze_support()
|
| 134 |
main()
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
import multiprocessing
|
| 4 |
+
|
| 5 |
+
# Install BrowserGym dependencies before running the main application
|
| 6 |
+
def install_browsergym():
|
| 7 |
+
try:
|
| 8 |
+
print("Installing BrowserGym dependencies...")
|
| 9 |
+
subprocess.run("cd BrowserGym && make install", shell=True, check=True)
|
| 10 |
+
print("BrowserGym installation completed successfully")
|
| 11 |
+
except subprocess.CalledProcessError as e:
|
| 12 |
+
print(f"Error installing BrowserGym: {e}")
|
| 13 |
+
raise
|
| 14 |
+
|
| 15 |
+
install_browsergym()
|
| 16 |
+
|
| 17 |
import os
|
| 18 |
import logging
|
| 19 |
import gradio as gr
|
|
|
|
| 125 |
demo.launch(share=True, max_threads=32)
|
| 126 |
|
| 127 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
# Add support for multiprocessing on Windows
|
| 129 |
multiprocessing.freeze_support()
|
| 130 |
main()
|