Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
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 |
|