anithai commited on
Commit
16352c5
·
verified ·
1 Parent(s): c299a01
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -1,16 +1,10 @@
1
  import gradio as gr
2
  import subprocess
3
- import shutil # For locating Java path dynamically
4
 
5
  def chatbot_interface(question):
6
- java_path = shutil.which("java") # Finds Java path dynamically
7
-
8
- if not java_path:
9
- return "Error: Java is not installed or not found in PATH."
10
-
11
  try:
12
  result = subprocess.run(
13
- [java_path, '-cp', '/app:/app/lib/json-20210307.jar', 'Main', question],
14
  capture_output=True,
15
  text=True
16
  )
@@ -35,4 +29,4 @@ iface = gr.Interface(
35
  description="Ask syllabus-related questions and get accurate responses."
36
  )
37
 
38
- iface.launch(server_name="0.0.0.0", server_port=7860)
 
1
  import gradio as gr
2
  import subprocess
 
3
 
4
  def chatbot_interface(question):
 
 
 
 
 
5
  try:
6
  result = subprocess.run(
7
+ ['java', '-cp', '/app/lib/json-20210307.jar:/app', 'Main', question],
8
  capture_output=True,
9
  text=True
10
  )
 
29
  description="Ask syllabus-related questions and get accurate responses."
30
  )
31
 
32
+ iface.launch()