Spaces:
Runtime error
Runtime error
Commit
·
08bae0a
1
Parent(s):
73c367e
Update test_gradio.py
Browse files- test_gradio.py +15 -3
test_gradio.py
CHANGED
@@ -1,6 +1,18 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
pip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
# Define the pip command
|
4 |
+
pip_command = ["pip", "install", "gradio"]
|
5 |
+
pip_command = ["pip", "install", "langchain"]
|
6 |
+
pip_command = ["pip", "install", "google-generativeai"]
|
7 |
+
# Run the pip command using subprocess
|
8 |
+
try:
|
9 |
+
# This will raise an error if the command fails
|
10 |
+
subprocess.run(pip_command, check=True)
|
11 |
+
subprocess.run(pip_command, check=True)
|
12 |
+
subprocess.run(pip_command, check=True)
|
13 |
+
print("done")
|
14 |
+
except subprocess.CalledProcessError as e:
|
15 |
+
print("Failed to install gradio:", e)
|
16 |
|
17 |
import gradio as gr
|
18 |
|