Instructions to use SeaLLMs/SeaLLM-7B-v2.5-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SeaLLMs/SeaLLM-7B-v2.5-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SeaLLMs/SeaLLM-7B-v2.5-GGUF", filename="seallm-7b-v2.5-chatml.Q4_K_M.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 SeaLLMs/SeaLLM-7B-v2.5-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
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 SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
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 SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
Use Docker
docker model run hf.co/SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use SeaLLMs/SeaLLM-7B-v2.5-GGUF with Ollama:
ollama run hf.co/SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
- Unsloth Studio
How to use SeaLLMs/SeaLLM-7B-v2.5-GGUF 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 SeaLLMs/SeaLLM-7B-v2.5-GGUF 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 SeaLLMs/SeaLLM-7B-v2.5-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SeaLLMs/SeaLLM-7B-v2.5-GGUF to start chatting
- Docker Model Runner
How to use SeaLLMs/SeaLLM-7B-v2.5-GGUF with Docker Model Runner:
docker model run hf.co/SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
- Lemonade
How to use SeaLLMs/SeaLLM-7B-v2.5-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SeaLLMs/SeaLLM-7B-v2.5-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.SeaLLM-7B-v2.5-GGUF-Q4_K_M
List all available models
lemonade list
Repetition Issues with Llamacpp
Hey everyone, I'm currently working with seallm-7b-v2.5.Q4_K_M.gguf for RAG. Here are the settings I'm using:
from llama_index.llms.llama_cpp import LlamaCPP
model_url = "https://huggingface.co/SeaLLMs/SeaLLM-7B-v2.5-GGUF/resolve/main/seallm-7b-v2.5.Q4_K_M.gguf"
llm = LlamaCPP(
model_url=model_url,
temperature=0.1,
max_new_tokens=1024,
context_window=8192,
generate_kwargs={},
model_kwargs={"n_gpu_layers": 64, "repeat_penalty": 1},
verbose=True
)
with this prompt
# SeaLLM 7b-v2.5
from llama_index.core import PromptTemplate, get_response_synthesizer
prompt="""
<bos><|im_start|>system
You are a helpful assistant. You will only answer based on provided document if relevant to users question.<eos>
<|im_start|>user
คุณเป็นแชทบอทของรัฐบาลที่ออกแบบมาเพื่อช่วยเหลือผู้ใช้ในการตอบคำถามตามเอกสาร "รวมกฎหมายที่ดินและสิ่งปลูกสร้าง" ให้ปฏิบัติตามแนวทางการให้เหตุผลแบบ Chain-Of-Thought ดังนี้
1) ตอบกลับเป็นภาษาไทย
2) ใช้บริบทที่ให้มาจากเอกสาร "รวมกฎหมายที่ดินและสิ่งปลูกสร้าง" เพื่อนำมาใช้ตอบคำถามอย่างมีเหตุผล
3) แบ่งปัญหาออกเป็นส่วนย่อยๆ หากจำเป็น และพิจารณาขั้นตอนดังต่อไปนี้ (provide step-by-step reasoning on how to answer the question):
ก) ระบุหัวข้อหลักหรือประเภทของคำถาม (เช่น การยกเว้นภาษี คำนิยามตามกฎหมาย การใช้ประโยชน์ที่ดิน)
ข) ค้นหาส่วนหรือข้อความในเอกสารที่อาจมีคำตอบ
ค) สกัดข้อมูลที่เกี่ยวข้องจากส่วนที่ระบุ
ง) นำข้อมูลที่สกัดมาใช้กับคำถามที่ถามโดยเฉพาะ
จ) สร้างคำตอบตามเนื้อหาของเอกสาร
4) ตอบคำถามแบบสั้นและกระชับ
5) หากไม่พบคำตอบในเอกสารหรือคำถามต้องการข้อมูลที่ไม่มี ให้ตอบว่า "ไม่รู้"
คุณจะได้รับรายละเอียดใน รวมกฎหมายที่ดินและสิ่งปลูกสร้าง ตามคำถามของผู้ใช้ รวมกฎหมายที่ดินและสิ่งปลูกสร้าง ใน ''' ด้านล่าง
'''
รวมกฎหมายที่ดินและสิ่งปลูกสร้าง: {context_str}
'''
ห้ามใช้ข้อมูลใดๆ นอกเหนือ "รวมกฎหมายที่ดินและสิ่งปลูกสร้าง" ที่ให้ไว้
QUESTION: {query_str} <eos>
<|im_start|>assistant
ANSWER: """
text_qa_template = PromptTemplate(prompt)
Here is the response from the model
400 ต้น
ตามข้อมูลในเอกสาร "รวมกฎหมาย ที่ดินและสิ่งปลูกสร้าง" บุคคลธรรมดาจะได้รับยกเว้นภาษีสำหรับการประกอบการเกษตรกรรมหากปลูกพืชนานาชนิดตามขั้นต่ำกำหนดไว้ โดยในกรณีนี้คือปลูกกล้วยต้องไม่ต่ำกว่าจำนวนต้นตามตารางกำหนดไว้ ดังนั้น หากบุคคลธรรมดาเจ้าหน้าทีดินจำนวนสองไร่ ต้องปลูกกล้วยไม่ต่ำกว่าจำนวนต้นตามตารางกำหนด ไว้คือปลูกกล้วยไม่ต่ำกว่าจำนวนต้นตามตารางกำหนดไว้คือปลูกกล้วยไม่ต่ำกว่าจำนวนต้นตามตารางกำหนดไว้คือปลูกกล้วยไม่ต่ำกว่าจำนวนต้นตามตารางกำหนดไว้คือปลูกกล้วย ....
I'm facing an issue with repeated text "ไว้คือปลูกกล้วยไม่ต่ำกว่าจำนวนต้นตามตารางกำหนด" until the max token limit is reached. The issue doesn't occur with SeaLLM-7B-v2.q8_0.gguf Any suggestions or help would be greatly appreciated!
have you try repeat_penalty=1.0
Hi folk,
If you would like to validate the results with full precision models, you can visit float16.cloud. I have been supporting SeaLLM-7b-v2.5 since its inception.
In the upcoming month, I will provide a deployment tutorial with LLamacpp on my GitHub.
Feel free to ask me any questions.