DeathDaDev commited on
Commit
f6e5cd9
·
verified ·
1 Parent(s): 3b3a846

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -1,19 +1,8 @@
 
1
  import gradio as gr
2
  import requests
3
- import subprocess
4
- import time
5
- import sys
6
 
7
- # Start the Ollama server and capture its URL output
8
- process = subprocess.Popen(['bash', 'run_ollama.sh'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
9
- stdout, stderr = process.communicate()
10
-
11
- # Check for errors or retrieve the URL from stdout
12
- if process.returncode != 0:
13
- print(f"Error starting Ollama: {stderr.decode()}")
14
- sys.exit(1)
15
-
16
- ollama_url = stdout.decode().strip().split('\n')[-1].split()[-1] # Extract the URL
17
 
18
  console_output = []
19
 
 
1
+ import os
2
  import gradio as gr
3
  import requests
 
 
 
4
 
5
+ ollama_url = os.getenv('OLLAMA_URL')
 
 
 
 
 
 
 
 
 
6
 
7
  console_output = []
8