Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,32 +19,32 @@ def test():
|
|
19 |
def process():
|
20 |
import subprocess
|
21 |
|
22 |
-
def uninstall_and_install_gradio(version):
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
|
31 |
-
# Gantilah "3.41.2" dengan versi Gradio yang diinginkan
|
32 |
-
desired_version = "3.41.2"
|
33 |
|
34 |
-
# Periksa versi Gradio yang terinstal
|
35 |
-
current_version_command = ["pip", "show", "gradio"]
|
36 |
-
result = subprocess.run(current_version_command, capture_output=True, text=True)
|
37 |
-
current_version = None
|
38 |
|
39 |
-
if "Version" in result.stdout:
|
40 |
-
|
41 |
|
42 |
-
# Cek dan lakukan uninstall dan install jika versi tidak sesuai
|
43 |
-
if current_version != desired_version:
|
44 |
-
|
45 |
-
|
46 |
-
else:
|
47 |
-
|
48 |
|
49 |
python_script = "aiDescUI.py"
|
50 |
|
|
|
19 |
def process():
|
20 |
import subprocess
|
21 |
|
22 |
+
# def uninstall_and_install_gradio(version):
|
23 |
+
# # Uninstall current Gradio
|
24 |
+
# uninstall_command = ["pip", "uninstall", "gradio", "-y"]
|
25 |
+
# subprocess.run(uninstall_command)
|
26 |
|
27 |
+
# # Install specific version of Gradio
|
28 |
+
# install_command = ["pip", "install", f"gradio=={version}"]
|
29 |
+
# subprocess.run(install_command)
|
30 |
|
31 |
+
# # Gantilah "3.41.2" dengan versi Gradio yang diinginkan
|
32 |
+
# desired_version = "3.41.2"
|
33 |
|
34 |
+
# # Periksa versi Gradio yang terinstal
|
35 |
+
# current_version_command = ["pip", "show", "gradio"]
|
36 |
+
# result = subprocess.run(current_version_command, capture_output=True, text=True)
|
37 |
+
# current_version = None
|
38 |
|
39 |
+
# if "Version" in result.stdout:
|
40 |
+
# current_version = result.stdout.split("Version:")[1].strip()
|
41 |
|
42 |
+
# # Cek dan lakukan uninstall dan install jika versi tidak sesuai
|
43 |
+
# if current_version != desired_version:
|
44 |
+
# uninstall_and_install_gradio(desired_version)
|
45 |
+
# print(f"Gradio has been updated to version {desired_version}")
|
46 |
+
# else:
|
47 |
+
# print(f"Gradio is already at version {desired_version}")
|
48 |
|
49 |
python_script = "aiDescUI.py"
|
50 |
|