ka1kuk commited on
Commit
4ade382
1 Parent(s): 048cbd1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -0
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