Instructions to use Minwoo-Study/AIHUB_IndonesianCorpus_Generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Minwoo-Study/AIHUB_IndonesianCorpus_Generation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Minwoo-Study/AIHUB_IndonesianCorpus_Generation") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Minwoo-Study/AIHUB_IndonesianCorpus_Generation") model = AutoModelForCausalLM.from_pretrained("Minwoo-Study/AIHUB_IndonesianCorpus_Generation", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Minwoo-Study/AIHUB_IndonesianCorpus_Generation with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Minwoo-Study/AIHUB_IndonesianCorpus_Generation" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Minwoo-Study/AIHUB_IndonesianCorpus_Generation", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Minwoo-Study/AIHUB_IndonesianCorpus_Generation
- SGLang
How to use Minwoo-Study/AIHUB_IndonesianCorpus_Generation with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Minwoo-Study/AIHUB_IndonesianCorpus_Generation" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Minwoo-Study/AIHUB_IndonesianCorpus_Generation", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "Minwoo-Study/AIHUB_IndonesianCorpus_Generation" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Minwoo-Study/AIHUB_IndonesianCorpus_Generation", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Minwoo-Study/AIHUB_IndonesianCorpus_Generation with Docker Model Runner:
docker model run hf.co/Minwoo-Study/AIHUB_IndonesianCorpus_Generation
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
99. ์ธ๋๋ค์์์ด ๋ง๋ญ์น ๋ฐ์ดํฐ -2. ์ธ์ด์์ฑ๋ชจ๋ธ
๋ชจ๋ธ ์ค๋ช
2023๋ ์ธ๊ณต์ง๋ฅ ํ์ต์ฉ ๋ฐ์ดํฐ ๊ตฌ์ถ์ฌ์ ์ผ๋ก ๊ตฌ์ถํ 2์ต ํ ํฐ ๊ท๋ชจ์ ์ธ๋๋ค์์์ด ๋ง๋ญ์น ๋ฐ์ดํฐ๋ก ์ด๊ฑฐ๋ AI ์ธ์ด์์ฑ๋ชจ๋ธ ๊ฐ๋ฐ
๋ชจ๋ธ ์ํคํ ์ฒ
META AI์์ ๊ฐ๋ฐํ ๋ค๊ตญ์ด ๋ชจ๋ธ LLaMA(Large Language Model Meta AI) ์ค LLaMA-2-7b-chat(https://huggingface.co/meta-llama/Llama-2-7b-chat-hf) ํ์ฉ
Unsupervised Finetuning
๋ง๋ญ์น ์ ์ฒด๋ก LoRA(Low Rank Adaptation)์ ํ์ฉํ Unsupervised Finetuing ์งํ
Supervised Finetuning
์ฌ์ ์ ์ ์ํ ํ๊ตญ ๊ด๋ จ ์ง๋ฌธ ๋ต๋ณ์ ์ ํตํ Supervised Finetuing ์งํ
๋ฐ์ดํฐ ์ค๋ช
Input
- ์ธ๋๋ค์์์ด๋ก ๋ชจ๋ธ์ ์ง๋ฌธ ํน์ ๋ช
๋ น ๊ฐ๋ฅ
ex :
Siapa sajakah penulis terkenal dari Korea? ํ๊ตญ์ ์ ๋ช ํ ์๊ฐ๋ ๋๊ตฌ์ธ๊ฐ์?
Output
- ์ธ๋๋ค์์์ด ๋ต๋ณ ์์ฑ ex : Penulis terkenal Korea: Kim Eun-sook, Park Ji-eun. ํ๊ตญ์ ์ ๋ช ์๊ฐ: ๊น์์, ๋ฐ์ง์.
ํ์ต ํ๋ผ๋ฏธํฐ
Unsupervised Finetuing / Supervised Finetuning ๋์ผ
--optim 'adamw_torch_fused' \
--seed 0 --data_seed 0 \
--dataloader_num_workers 30 \
--per_device_train_batch_size 2 --per_device_eval_batch_size 2 \
--low_cpu_mem_usage false \
--evaluation_strategy "steps" --eval_steps 5000 \
--save_strategy "steps" --save_steps 5000 \
--save_total_limit 2 \
--gradient_accumulation_steps 4 \
--learning_rate 3e-4 \
--lr_scheduler_type "cosine" \
--warmup_steps 28 \
--num_train_epochs 5 \
--use_lora \
--lora_rank 64 \
--lora_alpha 16 \
--lora_dropout 0.05 \
ํ๊ฐ ๊ธฐ์ค
Human Evaluation
- ์์ฑํ ๋ชจ๋ธ 6๊ฐ ์ค ๋น๊ต๋ชจ๋ธ 5๊ฐ ์ ์ (ChatGPT 3.5-Turbo, IndoGPT, BLOOMZ, mT0)
- ํ์ต๋ ๋ชจ๋ธ์ ํฌํจํ์ฌ 5๊ฐ ํ๋ณด๊ตฐ ๋ชจ๋ธ์ด ์์ฑํ ๊ฐ ๋ต๋ณ์ ๋ํด 3๋ช ์ ํ๊ฐ์๊ฐ ํ๊ฐํ ํ๊ท ์ ์๋ก ์ข ํฉ ์์๋ฅผ ํ๋จํจ.
- ํ๊ฐ์์๊ฒ๋ ๋ชจ๋ธ ์ ๋ณด๊ฐ ์ ๊ณต๋์ง ์์.
๋ชฉํ ์์ 3์ / ์ต์ข ์์ 2์
์ ์๊ถ ๋ผ์ด์ผ์ค ํ๊ธฐ
MIT License
Copyright (c) 2024 Arspraxia
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Downloads last month
- 9