organatceo commited on
Commit
99dad45
·
verified ·
1 Parent(s): fb751a5

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,6 @@ import threading
4
  import spaces
5
  import gradio as gr
6
  from huggingface_hub import hf_hub_download
7
- from llama_cpp import Llama
8
 
9
  logging.basicConfig(level=logging.INFO)
10
  log = logging.getLogger(__name__)
@@ -37,9 +36,10 @@ threading.Thread(target=download_model, daemon=True).start()
37
  def generate(messages, max_tokens=1024, temperature=0.7, top_p=0.95):
38
  global _llm
39
  if _llm is None:
 
40
  _downloaded.wait()
41
  log.info("Loading model into GPU...")
42
- _llm = Llama(
43
  model_path=MODEL_PATH,
44
  n_gpu_layers=-1,
45
  n_ctx=8192,
 
4
  import spaces
5
  import gradio as gr
6
  from huggingface_hub import hf_hub_download
 
7
 
8
  logging.basicConfig(level=logging.INFO)
9
  log = logging.getLogger(__name__)
 
36
  def generate(messages, max_tokens=1024, temperature=0.7, top_p=0.95):
37
  global _llm
38
  if _llm is None:
39
+ from llama_cpp import Llama as _Llama
40
  _downloaded.wait()
41
  log.info("Loading model into GPU...")
42
+ _llm = _Llama(
43
  model_path=MODEL_PATH,
44
  n_gpu_layers=-1,
45
  n_ctx=8192,