Update src/summarization.py
Browse files- src/summarization.py +2 -0
src/summarization.py
CHANGED
|
@@ -2,7 +2,9 @@
|
|
| 2 |
from llama_cpp import Llama
|
| 3 |
from utils import available_gguf_llms, s2tw_converter
|
| 4 |
import time
|
|
|
|
| 5 |
|
|
|
|
| 6 |
def get_model(gguf_repo_id, gguf_filename):
|
| 7 |
return Llama.from_pretrained(
|
| 8 |
repo_id=gguf_repo_id,
|
|
|
|
| 2 |
from llama_cpp import Llama
|
| 3 |
from utils import available_gguf_llms, s2tw_converter
|
| 4 |
import time
|
| 5 |
+
from functools import lru_cache
|
| 6 |
|
| 7 |
+
@lru_cache(maxsize=1)
|
| 8 |
def get_model(gguf_repo_id, gguf_filename):
|
| 9 |
return Llama.from_pretrained(
|
| 10 |
repo_id=gguf_repo_id,
|