Entz commited on
Commit
72d2141
1 Parent(s): 8fbe745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -23,8 +23,8 @@ OLLAMA_SERVICE_THREAD.start()
23
  print("Giving Ollama serve a moment to start")
24
  time.sleep(10)
25
 
26
- print("Setting model to 'gemma2'")
27
- model = "gemma2"
28
 
29
  print(f"Pulling model {model}")
30
  subprocess.run(f"~/ollama pull {model}", shell=True)
@@ -36,11 +36,11 @@ import gradio as gr
36
  from ollama import Client
37
 
38
  print("Initializing Ollama client")
39
- client = Client(host='http://localhost:11434', timeout=120)
40
 
41
  print("Getting Hugging Face token and model ID from environment variables")
42
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
43
- MODEL_ID = os.environ.get("MODEL_ID", "google/gemma-2-9b-it")
44
  MODEL_NAME = MODEL_ID.split("/")[-1]
45
 
46
  print("Setting up title and description for Gradio interface")
@@ -64,6 +64,7 @@ h3 {
64
  """
65
  import streamlit as st
66
  from llama_index.llms.ollama import Ollama
 
67
 
68
  # Initialize the Ollama model
69
  llm = Ollama(model="llama3", request_timeout=120.0)
 
23
  print("Giving Ollama serve a moment to start")
24
  time.sleep(10)
25
 
26
+ print("Setting model to 'llama3'")
27
+ model = "llama3"
28
 
29
  print(f"Pulling model {model}")
30
  subprocess.run(f"~/ollama pull {model}", shell=True)
 
36
  from ollama import Client
37
 
38
  print("Initializing Ollama client")
39
+ client = Client(host='http://localhost:11435', timeout=60)
40
 
41
  print("Getting Hugging Face token and model ID from environment variables")
42
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
43
+ MODEL_ID = os.environ.get("MODEL_ID", "meta-llama/Meta-Llama-3-8B")
44
  MODEL_NAME = MODEL_ID.split("/")[-1]
45
 
46
  print("Setting up title and description for Gradio interface")
 
64
  """
65
  import streamlit as st
66
  from llama_index.llms.ollama import Ollama
67
+ from myollama import ollama
68
 
69
  # Initialize the Ollama model
70
  llm = Ollama(model="llama3", request_timeout=120.0)