Instructions to use Pudding48/TinyLLamaTest with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Pudding48/TinyLLamaTest with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Pudding48/TinyLLamaTest", filename="tinyllama-1.1b-chat-v1.0.Q8_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Pudding48/TinyLLamaTest with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Pudding48/TinyLLamaTest:Q8_0 # Run inference directly in the terminal: llama-cli -hf Pudding48/TinyLLamaTest:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Pudding48/TinyLLamaTest:Q8_0 # Run inference directly in the terminal: llama-cli -hf Pudding48/TinyLLamaTest:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Pudding48/TinyLLamaTest:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf Pudding48/TinyLLamaTest:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Pudding48/TinyLLamaTest:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Pudding48/TinyLLamaTest:Q8_0
Use Docker
docker model run hf.co/Pudding48/TinyLLamaTest:Q8_0
- LM Studio
- Jan
- Ollama
How to use Pudding48/TinyLLamaTest with Ollama:
ollama run hf.co/Pudding48/TinyLLamaTest:Q8_0
- Unsloth Studio new
How to use Pudding48/TinyLLamaTest with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Pudding48/TinyLLamaTest to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Pudding48/TinyLLamaTest to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Pudding48/TinyLLamaTest to start chatting
- Docker Model Runner
How to use Pudding48/TinyLLamaTest with Docker Model Runner:
docker model run hf.co/Pudding48/TinyLLamaTest:Q8_0
- Lemonade
How to use Pudding48/TinyLLamaTest with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Pudding48/TinyLLamaTest:Q8_0
Run and chat with the model
lemonade run user.TinyLLamaTest-Q8_0
List all available models
lemonade list
Delete prepare_vector_dp.py
Browse files- prepare_vector_dp.py +0 -48
prepare_vector_dp.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 1 |
-
from langchain.text_splitter import RecursiveCharacterTextSplitter, CharacterTextSplitter
|
| 2 |
-
from langchain_community.document_loaders import PyPDFLoader, DirectoryLoader
|
| 3 |
-
from langchain_community.vectorstores import FAISS
|
| 4 |
-
from langchain_community.embeddings import GPT4AllEmbeddings
|
| 5 |
-
|
| 6 |
-
# Khai bao bien
|
| 7 |
-
pdf_data_path = "data"
|
| 8 |
-
vector_dp_path = "vectorstores/db_faiss"
|
| 9 |
-
|
| 10 |
-
os.makedirs(pdf_data_path, exist_ok=True)
|
| 11 |
-
os.makedirs(vector_dp_path, exist_ok=True)
|
| 12 |
-
|
| 13 |
-
# Ham 1. Tao ra vector DB tu 1 doan text
|
| 14 |
-
def create_db_from_text():
|
| 15 |
-
raw_text = "Trường Đại học Khoa học – Đại học Huế là một trong những cơ sở đào tạo và nghiên cứu hàng đầu tại khu vực miền Trung và Tây Nguyên. Được thành lập từ năm 1957, trường có bề dày truyền thống trong giảng dạy các ngành khoa học tự nhiên, xã hội và nhân văn. Với đội ngũ giảng viên giàu kinh nghiệm, cơ sở vật chất hiện đại và môi trường học tập năng động, Trường Đại học Khoa học luôn là lựa chọn uy tín của sinh viên trong và ngoài nước. Trường hiện tọa lạc tại số 77 Nguyễn Huệ, thành phố Huế – trung tâm văn hóa, giáo dục lớn của cả nước."
|
| 16 |
-
|
| 17 |
-
text_splitter = CharacterTextSplitter(
|
| 18 |
-
separator="\n",
|
| 19 |
-
chunk_size=512,
|
| 20 |
-
chunk_overlap=50,
|
| 21 |
-
length_function=len
|
| 22 |
-
)
|
| 23 |
-
|
| 24 |
-
chunks = text_splitter.split_text(raw_text)
|
| 25 |
-
|
| 26 |
-
# Embeding
|
| 27 |
-
embedding_model = GPT4AllEmbeddings(model_file= "tinyllama-1.1b-chat-v1.0.Q8_0.gguf")
|
| 28 |
-
|
| 29 |
-
# Dua vao Faiss Vector DB
|
| 30 |
-
db = FAISS.from_texts(texts=chunks, embedding=embedding_model)
|
| 31 |
-
db.save_local(vector_dp_path)
|
| 32 |
-
return db
|
| 33 |
-
|
| 34 |
-
def create_dp_from_files():
|
| 35 |
-
# Khai bao loader de quet toan bo thu muc data
|
| 36 |
-
loader = DirectoryLoader(pdf_data_path, glob="*.pdf",loader_cls=PyPDFLoader)
|
| 37 |
-
documents = loader.load()
|
| 38 |
-
|
| 39 |
-
text_splitter = CharacterTextSplitter(chunk_size = 512, chunk_overlap = 50)
|
| 40 |
-
chunks = text_splitter.split_documents(documents)
|
| 41 |
-
|
| 42 |
-
embedding_model = GPT4AllEmbeddings(model_file = "tinyllama-1.1b-chat-v1.0.Q8_0.gguf")
|
| 43 |
-
dp = FAISS.from_documents(chunks, embedding_model)
|
| 44 |
-
dp.save_local(vector_dp_path)
|
| 45 |
-
return dp
|
| 46 |
-
|
| 47 |
-
# create_db_from_text()
|
| 48 |
-
create_dp_from_files()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|