tori29umai commited on
Commit
c3199d5
1 Parent(s): 20e3524

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  from jinja2 import Template
3
  from llama_cpp import Llama
@@ -57,6 +58,7 @@ def load_settings_from_ini(filename='character_settings.ini'):
57
 
58
  # LlamaCppのラッパークラス
59
  class LlamaCppAdapter:
 
60
  def __init__(self, model_path, n_ctx=4096):
61
  print(f"モデルの初期化: {model_path}")
62
  self.llama = Llama(model_path=model_path, n_ctx=n_ctx, n_gpu_layers=-1)
 
1
+ import spaces
2
  import gradio as gr
3
  from jinja2 import Template
4
  from llama_cpp import Llama
 
58
 
59
  # LlamaCppのラッパークラス
60
  class LlamaCppAdapter:
61
+ @spaces.GPU(duration=120)
62
  def __init__(self, model_path, n_ctx=4096):
63
  print(f"モデルの初期化: {model_path}")
64
  self.llama = Llama(model_path=model_path, n_ctx=n_ctx, n_gpu_layers=-1)