Uniaff commited on
Commit
ef239d3
·
verified ·
1 Parent(s): 0f5a06e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -5,12 +5,14 @@ import gradio as gr
5
  import requests
6
  from langchain.prompts import ChatPromptTemplate
7
  from langchain_community.llms import Ollama
 
8
 
9
  from func_ai import classify_comment, retrieve_from_vdb, VECTOR_API_URL
10
  from func_facebook import get_page_id, has_page_replied, get_unanswered_comments, reply_comment, hide_negative_comments
11
 
12
- os.system('curl -o- https://ollama.com/download.sh | bash')
13
- os.system('ollama pull llama3.1')
 
14
 
15
  # Start Ollama server in the background
16
  os.system('ollama serve')
 
5
  import requests
6
  from langchain.prompts import ChatPromptTemplate
7
  from langchain_community.llms import Ollama
8
+ import subprocess
9
 
10
  from func_ai import classify_comment, retrieve_from_vdb, VECTOR_API_URL
11
  from func_facebook import get_page_id, has_page_replied, get_unanswered_comments, reply_comment, hide_negative_comments
12
 
13
+ subprocess.check_call(['curl', '-o-', 'https://ollama.com/download.sh', '|', 'bash'])
14
+ subprocess.check_call(['ollama', 'pull', 'llama3.1'])
15
+ subprocess.Popen(['ollama', 'serve'])
16
 
17
  # Start Ollama server in the background
18
  os.system('ollama serve')