Views
No views yet
### Instruction:
จะทำอะไรก็เรื่องของมึง
### Response:
ด่าผมอีกสิครับ| Name | Quant method | Bits | Size | Use case |
|---|---|---|---|---|
| tc-instruct-dpo.Q2_K.gguf | Q2_K | 2 | 2.88 GB | smallest, significant quality loss - not recommended for most purposes |
| tc-instruct-dpo.Q3_K_S.gguf | Q3_K_S | 3 | 2.96 GB | very small, high quality loss |
| tc-instruct-dpo.Q3_K_M.gguf | Q3_K_M | 3 | 3.29 GB | very small, high quality loss |
| tc-instruct-dpo.Q3_K_L.gguf | Q3_K_L | 3 | 3.57 GB | small, substantial quality loss |
| tc-instruct-dpo.Q4_0.gguf | Q4_0 | 4 | 3.84 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
| tc-instruct-dpo.Q4_K_S.gguf | Q4_K_S | 4 | 3.87 GB | small, greater quality loss |
| tc-instruct-dpo.Q4_K_M.gguf | Q4_K_M | 4 | 4.08 GB | medium, balanced quality - recommended |
| tc-instruct-dpo.Q5_0.gguf | Q5_0 | 5 | 4.67 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
| tc-instruct-dpo.Q5_K_S.gguf | Q5_K_S | 5 | 4.67 GB | large, low quality loss - recommended |
| tc-instruct-dpo.Q5_K_M.gguf | Q5_K_M | 5 | 4.79 GB | large, very low quality loss - recommended |
| tc-instruct-dpo.Q6_K.gguf | Q6_K | 6 | 5.55 GB | very large, extremely low quality loss |
| tc-instruct-dpo.Q8_0.gguf | Q8_0 | 8 | 7.19 GB | very large, extremely low quality loss - not recommended |
| tc-instruct-dpo.F16.gguf | F16 | 16 | 13.53 GB | largest, original quality - not recommended |
text-generation-webuihuggingface-hub Python library:pip3 install huggingface-hub>=0.17.1huggingface-cli download pek111/TC-instruct-DPO-GGUF tc-instruct-dpo.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks Falsehuggingface-cli download pek111/TC-instruct-DPO-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'huggingface-cli, please see: HF -> Hub Python Library -> Download files -> Download from the CLI.hf_transfer:pip3 install hf_transferHF_HUB_ENABLE_HF_TRANSFER to 1:HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Llama-2-13B-GGUF llama-2-13b.q4_K_M.gguf --local-dir . --local-dir-use-symlinks Falseset HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 or $env:HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 before running the download command.llama.cpp commandllama.cpp from commit d0cee0d36d5be95a0d9088b674dbb27354107221 or later../main -ngl 32 -m tc-instruct-dpo.Q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "{prompt}"-ngl 32 to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.-c 4096 to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically.-p <PROMPT> argument with -i -instext-generation-webui1# Base llama-cpp-python with no GPU acceleration
2pip install llama-cpp-python
3# With NVidia CUDA acceleration
4CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
5# Or with OpenBLAS acceleration
6CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
7# Or with CLBLast acceleration
8CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
9# Or with AMD ROCm GPU acceleration (Linux only)
10CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
11# Or with Metal GPU acceleration for macOS systems only
12CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
13
14# In Windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for Nvidia CUDA:
15$env:CMAKE_ARGS = "-DLLAMA_CUDA=on"
16pip install llama_cpp_python --verbose
17# If BLAS = 0 try installing with these commands instead (Windows + CUDA)
18set CMAKE_ARGS="-DLLAMA_CUDA=on"
19set FORCE_CMAKE=1
20$env:CMAKE_ARGS = "-DLLAMA_CUDA=on"
21$env:FORCE_CMAKE = 1
22python -m pip install llama_cpp_python>=0.2.26 --verbose --force-reinstall --no-cache-dir1import llama_cpp
2
3llm_cpp = llama_cpp.Llama(
4 model_path="tc-instruct-dpo.Q4_K_M.gguf", # Path to the model
5 n_threads=10, # CPU cores
6 n_batch=512, # Should be between 1 and n_ctx, consider the amount of VRAM in your GPU.
7 n_gpu_layers=35, # Change this value based on your model and your GPU VRAM pool.
8 n_ctx=4096, # Max context length
9)
10
11prompt = """
12### Instruction:
13สวัสดีครับ ผมชื่อเอก
14
15### Response:
16"""
17
18response = llm_cpp(
19 prompt=prompt,
20 max_tokens=256,
21 temperature=0.5,
22 top_k=1,
23 repeat_penalty=1.1,
24 echo=True
25)
26
27print(response)1{
2 "id": "cmpl-a8d5746d-25fb-43b6-8b04-b562db72df2b",
3 "object": "text_completion",
4 "created": 1714460999,
5 "model": "tc-instruct-dpo.Q4_K_M.gguf",
6 "choices": [
7 {
8 "text": "\n### Instruction:\nสวัสดีครับ ผมชื่อเอก\n\n### Response:\nสวัสดีครับ\n ",
9 "index": 0,
10 "logprobs": None,
11 "finish_reason": "stop"
12 }
13 ],
14 "usage": {
15 "prompt_tokens": 21,
16 "completion_tokens": 7,
17 "total_tokens": 28
18 }
19}### Instruction:
จะทำอะไรก็เรื่องของมึง
### Response:
ด่าผมอีกสิครับ1# Requires pytorch, transformers, bitsandbytes, sentencepiece, protobuf, and flash-attn packages
2
3import torch
4from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, GenerationConfig
5import time
6
7base_model_id = "tanamettpk/TC-instruct-DPO"
8
9
10input_text = """
11### Instruction:
12ด่าฉันด้วยคำหยาบคายหน่อย
13
14### Response:
15"""
16
17model = AutoModelForCausalLM.from_pretrained(
18 base_model_id,
19 low_cpu_mem_usage=True,
20 return_dict=True,
21 device_map={"": 0},
22)
23tokenizer = AutoTokenizer.from_pretrained(base_model_id)
24
25generation_config = GenerationConfig(
26 do_sample=True,
27 top_k=1,
28 temperature=0.5,
29 max_new_tokens=300,
30 repetition_penalty=1.1,
31 pad_token_id=tokenizer.eos_token_id)
32
33# Tokenize input
34inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
35
36# Generate outputs
37st_time = time.time()
38outputs = model.generate(**inputs, generation_config=generation_config)
39
40# Decode and print response
41response = tokenizer.decode(outputs[0], skip_special_tokens=True)
42print(f"Response time: {time.time() - st_time} seconds")
43print(response)1@misc{TC-instruct-DPO,
2 url={[https://huggingface.co/tanamettpk/TC-instruct-DPO]https://huggingface.co/tanamettpk/TC-instruct-DPO)},
3 title={TC-instruct-DPO},
4 author={"tanamettpk", "tanamettpk", "tanamettpk", "and", "tanamettpk"}
5}