Spaces:
Build error
Build error
app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import subprocess
|
| 3 |
-
import shutil # For
|
| 4 |
|
| 5 |
def chatbot_interface(question):
|
| 6 |
-
|
|
|
|
| 7 |
if not java_path:
|
| 8 |
-
return "Error: Java is not installed or cannot be found."
|
| 9 |
|
| 10 |
try:
|
| 11 |
result = subprocess.run(
|
|
@@ -35,4 +36,3 @@ iface = gr.Interface(
|
|
| 35 |
)
|
| 36 |
|
| 37 |
iface.launch()
|
| 38 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import subprocess
|
| 3 |
+
import shutil # For locating Java dynamically
|
| 4 |
|
| 5 |
def chatbot_interface(question):
|
| 6 |
+
# Locate Java path dynamically
|
| 7 |
+
java_path = shutil.which("java")
|
| 8 |
if not java_path:
|
| 9 |
+
return "Error: Java is still not installed or cannot be found."
|
| 10 |
|
| 11 |
try:
|
| 12 |
result = subprocess.run(
|
|
|
|
| 36 |
)
|
| 37 |
|
| 38 |
iface.launch()
|
|
|