Update main.py
Browse files
main.py
CHANGED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
try:
|
| 5 |
-
result = subprocess.run(command, shell=True, check=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 6 |
-
print(f"Success: {result.stdout}")
|
| 7 |
-
except subprocess.CalledProcessError as e:
|
| 8 |
-
print(f"Error: {e.stderr}")
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
|
| 4 |
+
reqUrl = "http://localhost:11434/api/pull"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
headersList = {
|
| 7 |
+
"Accept": "*/*",
|
| 8 |
+
"Content-Type": "application/json"
|
| 9 |
+
}
|
| 10 |
|
| 11 |
+
payload = json.dumps({
|
| 12 |
+
"name": "gemma:7b"
|
| 13 |
+
})
|
| 14 |
+
|
| 15 |
+
response = requests.request("POST", reqUrl, data=payload, headers=headersList)
|
| 16 |
+
|
| 17 |
+
print(response.text)
|