Spaces:
Sleeping
Sleeping
Download app/model_loader.py from VietCat/tinyLlama1B: direct link, hf CLI and curl.
- Browser
- Download file 271 Bytes
-
https://huggingface.co/spaces/VietCat/tinyLlama1B/resolve/main/app/model_loader.py
- Command line
-
hf download hf://spaces/VietCat/tinyLlama1B/app/model_loader.py
-
curl -L -o model_loader.py https://huggingface.co/spaces/VietCat/tinyLlama1B/resolve/main/app/model_loader.py
271 Bytes
| from llama_cpp import Llama | |
| llm = None # Sẽ được khởi tạo sau | |
| def load_model(): | |
| global llm | |
| if llm is None: | |
| llm = Llama( | |
| model_path="models/tinyllama.gguf", | |
| n_ctx=2048, | |
| n_threads=4, | |
| ) | |
| return llm | |