theotherdylan commited on
Commit
5bea577
·
1 Parent(s): 120e3f7

pull model

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,9 +1,12 @@
 
 
 
 
1
  import subprocess
 
2
  #from transformers import pipeline
3
  import ollama
4
  import gradio
5
- import os
6
- import threading
7
 
8
  OLLAMA = os.path.expanduser("~/ollama")
9
 
@@ -11,11 +14,17 @@ if not os.path.exists(OLLAMA):
11
  subprocess.run("curl -L https://ollama.com/download/ollama-linux-amd64 -o ~/ollama", shell=True)
12
  os.chmod(OLLAMA, 0o755)
13
 
 
14
  history = []
15
 
16
  def ollama_service_thread():
17
  subprocess.run("~/ollama serve", shell=True)
18
 
 
 
 
 
 
19
  OLLAMA_SERVICE_THREAD = threading.Thread(target=ollama_service_thread)
20
  OLLAMA_SERVICE_THREAD.start()
21
 
 
1
+
2
+ import os
3
+ import threading
4
+ import time
5
  import subprocess
6
+
7
  #from transformers import pipeline
8
  import ollama
9
  import gradio
 
 
10
 
11
  OLLAMA = os.path.expanduser("~/ollama")
12
 
 
14
  subprocess.run("curl -L https://ollama.com/download/ollama-linux-amd64 -o ~/ollama", shell=True)
15
  os.chmod(OLLAMA, 0o755)
16
 
17
+
18
  history = []
19
 
20
  def ollama_service_thread():
21
  subprocess.run("~/ollama serve", shell=True)
22
 
23
+ print("Giving ollama serve a moment")
24
+ time.sleep(10)
25
+ subprocess.run("~/ollama pull tinydolphin:latest")
26
+
27
+
28
  OLLAMA_SERVICE_THREAD = threading.Thread(target=ollama_service_thread)
29
  OLLAMA_SERVICE_THREAD.start()
30