Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
import requests
|
2 |
-
import json
|
3 |
import subprocess
|
4 |
|
5 |
def run_command(command):
|
@@ -9,19 +7,12 @@ def run_command(command):
|
|
9 |
except subprocess.CalledProcessError as e:
|
10 |
print(f"Error: {e.stderr}")
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
headersList = {
|
17 |
-
"Accept": "*/*",
|
18 |
-
"Content-Type": "application/json"
|
19 |
-
}
|
20 |
-
|
21 |
-
payload = json.dumps({
|
22 |
-
"name": "gemma:7b"
|
23 |
-
})
|
24 |
-
|
25 |
-
response = requests.request("POST", reqUrl, data=payload, headers=headersList)
|
26 |
-
|
27 |
-
print(response.text)
|
|
|
|
|
|
|
1 |
import subprocess
|
2 |
|
3 |
def run_command(command):
|
|
|
7 |
except subprocess.CalledProcessError as e:
|
8 |
print(f"Error: {e.stderr}")
|
9 |
|
10 |
+
def main():
|
11 |
+
# Install script
|
12 |
+
run_command("curl -fsSL https://ollama.com/install.sh | sh")
|
13 |
+
|
14 |
+
# Start Ollama server
|
15 |
+
run_command("ollama serve")
|
16 |
|
17 |
+
if __name__ == "__main__":
|
18 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|