Update main.py
Browse files
main.py
CHANGED
|
@@ -1,5 +1,15 @@
|
|
| 1 |
import requests
|
| 2 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
reqUrl = "http://localhost:11434/api/pull"
|
| 5 |
|
|
|
|
| 1 |
import requests
|
| 2 |
import json
|
| 3 |
+
import subprocess
|
| 4 |
+
|
| 5 |
+
def run_command(command):
|
| 6 |
+
try:
|
| 7 |
+
result = subprocess.run(command, shell=True, check=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 8 |
+
print(f"Success: {result.stdout}")
|
| 9 |
+
except subprocess.CalledProcessError as e:
|
| 10 |
+
print(f"Error: {e.stderr}")
|
| 11 |
+
|
| 12 |
+
run_command("ollama serve")
|
| 13 |
|
| 14 |
reqUrl = "http://localhost:11434/api/pull"
|
| 15 |
|