huangyt/FINETUNE1
Viewer • Updated • 170k • 10 • 1
How to use CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16")
model = AutoModelForCausalLM.from_pretrained("CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16")How to use CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16
How to use CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16 with Docker Model Runner:
docker model run hf.co/CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16
在llama-2-13b上使用huangyt/FINETUNE1資料集進行訓練,總資料筆數約17w
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA |
|---|---|---|---|---|---|
| meta-llama/Llama-2-13b-hf | 56.9 | 58.11 | 80.97 | 54.34 | 34.17 |
| meta-llama/Llama-2-13b-chat-hf | 59.93 | 59.04 | 81.94 | 54.64 | 44.12 |
| CHIH-HUNG/llama-2-13b-Fintune_1_17w | 58.24 | 59.47 | 81 | 54.31 | 38.17 |
| CHIH-HUNG/llama-2-13b-huangyt_Fintune_1_17w-q_k_v_o_proj | 58.49 | 59.73 | 81.06 | 54.53 | 38.64 |
| CHIH-HUNG/llama-2-13b-Fintune_1_17w-gate_up_down_proj | 58.81 | 57.17 | 82.26 | 55.89 | 39.93 |
| CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r16 | 58.86 | 57.25 | 82.27 | 56.16 | 39.75 |
| CHIH-HUNG/llama-2-13b-FINETUNE1_17w-r4 | 58.71 | 56.74 | 82.27 | 56.18 | 39.65 |
import json
from datasets import load_dataset
# 讀取數據集,take可以取得該數據集前n筆資料
dataset = load_dataset("huangyt/FINETUNE1", split="train", streaming=True)
# 提取所需欄位並建立新的字典列表
extracted_data = []
for example in dataset:
extracted_example = {
"instruction": example["instruction"],
"input": example["input"],
"output": example["output"]
}
extracted_data.append(extracted_example)
# 指定 JSON 文件名稱
json_filename = "huangyt_FINETUNE_1.json"
# 寫入 JSON 文件
with open(json_filename, "w") as json_file:
json.dump(extracted_data, json_file, indent=4)
print(f"數據已提取並保存為 {json_filename}")