Text Generation
Transformers
Safetensors
Korean
mistral
unsloth
trl
sft
conversational
text-generation-inference
Instructions to use mintaeng/small_fut_final with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mintaeng/small_fut_final with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mintaeng/small_fut_final") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mintaeng/small_fut_final") model = AutoModelForCausalLM.from_pretrained("mintaeng/small_fut_final", 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 mintaeng/small_fut_final with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mintaeng/small_fut_final" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mintaeng/small_fut_final", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mintaeng/small_fut_final
- SGLang
How to use mintaeng/small_fut_final 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 "mintaeng/small_fut_final" \ --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": "mintaeng/small_fut_final", "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 "mintaeng/small_fut_final" \ --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": "mintaeng/small_fut_final", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use mintaeng/small_fut_final 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 mintaeng/small_fut_final 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 mintaeng/small_fut_final to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mintaeng/small_fut_final to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="mintaeng/small_fut_final", max_seq_length=2048, ) - Docker Model Runner
How to use mintaeng/small_fut_final with Docker Model Runner:
docker model run hf.co/mintaeng/small_fut_final
| library_name: transformers | |
| tags: | |
| - unsloth | |
| - trl | |
| - sft | |
| datasets: | |
| - mintaeng/llm_futsaldata_yo | |
| license: apache-2.0 | |
| language: | |
| - ko | |
| # FUT FUT CHAT BOT | |
| - μ€νμμ€ λͺ¨λΈμ LLM fine tuning κ³Ό RAG λ₯Ό μ μ© | |
| - νμ΄μ λν κ΄μ¬μ΄ λμμ§λ©΄μ μμ λλΉ μ λ¬Έμλ₯Ό μν μ 보 μ 곡 μλΉμ€κ° νμνλ€κ³ λκ»΄ μ μνκ² λ¨ | |
| - νμ΄ νλ«νΌμ μ¬μ©λλ νμ΄ μ 보 λμ°λ―Έ μ±λ΄ | |
| - 'ν΄μ체'λ‘ λ΅νλ©° λ¬Έμ₯ λμ 'μΌλ§λ μ§ λ¬Όμ΄λ³΄μΈμ~ νν~!' μ μΆλ ₯ν¨ | |
| ## HOW TO USE | |
| ``` python | |
| #!pip install transformers==4.40.0 accelerate | |
| import os | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| model_id = 'Dongwookss/small_fut_final' | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto", | |
| ) | |
| model.eval() | |
| ``` | |
| **Query** | |
| ```python | |
| from transformers import TextStreamer | |
| PROMPT = '''Below is an instruction that describes a task. Write a response that appropriately completes the request. | |
| μ μνλ contextμμλ§ λλ΅νκ³ contextμ μλ λ΄μ©μ λͺ¨λ₯΄κ² λ€κ³ λλ΅ν΄''' | |
| messages = [ | |
| {"role": "system", "content": f"{PROMPT}"}, | |
| {"role": "user", "content": f"{instruction}"} | |
| ] | |
| input_ids = tokenizer.apply_chat_template( | |
| messages, | |
| add_generation_prompt=True, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| terminators = [ | |
| tokenizer.eos_token_id, | |
| tokenizer.convert_tokens_to_ids("<|eot_id|>") | |
| ] | |
| text_streamer = TextStreamer(tokenizer) | |
| _ = model.generate( | |
| input_ids, | |
| max_new_tokens=4096, | |
| eos_token_id=terminators, | |
| do_sample=True, | |
| streamer = text_streamer, | |
| temperature=0.6, | |
| top_p=0.9, | |
| repetition_penalty = 1.1 | |
| ) | |
| ``` | |
| ## Model Details | |
| ### Model Description | |
| This is the model card of a π€ transformers model that has been pushed on the Hub. This model card has been automatically generated. | |
| - **Developed by:** Dongwookss | |
| - **Model type:** text generation | |
| - **Language(s) (NLP):** Korean | |
| - **Finetuned from model :** HuggingFaceH4/zephyr-7b-beta | |
| ### Data | |
| https://huggingface.co/datasets/Dongwookss/q_a_korean_futsal | |
| νμ΅ λ°μ΄ν°μ μ nlpai-lab/databricks-dolly-15k-ko λ₯Ό λ² μ΄μ€λ‘ μΆκ°, ꡬμΆ, μ μ²λ¦¬ μ§νν 2.33k λ°μ΄ν°λ‘ νλνμμ΅λλ€. | |
| λ°μ΄ν°μ μ instruction, input, output μΌλ‘ ꡬμ±λμ΄ μμΌλ©° tuning λͺ©νμ λ§κ² λ§ν¬ μμ νμμ΅λλ€. | |
| λλ©μΈ μ 보μ λν λ°μ΄ν° μΆκ°νμμ΅λλ€. | |
| ## Training & Result | |
| ### Training Procedure | |
| LoRAμ SFT Trainer λ°©μμ μ¬μ©νμμ΅λλ€. | |
| #### Training Hyperparameters | |
| - **Training regime:** bf16 mixed precision | |
| ``` | |
| r=32, | |
| lora_alpha=64, # QLoRA : alpha = r/2 // LoRA : alpha =r*2 | |
| lora_dropout=0.05, | |
| target_modules=[ | |
| "q_proj", | |
| "k_proj", | |
| "v_proj", | |
| "o_proj", | |
| "gate_proj", | |
| "up_proj", | |
| "down_proj", | |
| ], # νκ² λͺ¨λ | |
| ``` | |
| ### Result | |
| https://github.com/lucide99/Chatbot_FutFut | |
| <!-- ## Bias, Risks, and Limitations --> | |
| <!-- ## Model Examination [optional] --> | |
| ## Environment | |
| L4 GPU | |
| <!-- ## contributors --> | |