| | --- |
| | language: |
| | - ko |
| | - en |
| | tags: |
| | - text-generation |
| | - keyword-extraction |
| | - tag-generation |
| | license: apache-2.0 |
| | --- |
| | |
| | # Qwen3-0.6B Float:Right Tagger (https://float-right.app) |
| |
|
| | This repository contains a fine-tuned tag generator based on **Qwen/Qwen3-0.6B**. |
| | This model was built for on-device AI tag generation in the Float:Right app. |
| | Float:Right is an automatic tag generation and classification app |
| |
|
| | GGUF : https://huggingface.co/FloatDo/qwen3-0.6b-float-right-tagger-GGUF |
| |
|
| | ์ด๊ฒ์ Float:Right ์ฑ์ ์ฌ์ฉํ ์จ๋๋ฐ์ด์ค AI ํ๊ทธ์์ฑ์ฉ๋๋ก ๋ง๋ค์ด์ก์ต๋๋ค. |
| | ์๋ ํ๊ทธ์์ฑ, ๋ถ๋ฅ์ฑ Float:Right. |
| |
|
| | https://float-right.app |
| |
|
| | ## What it does |
| |
|
| | Given a memo/text, it returns **a JSON array of 3โ10 tags**: |
| |
|
| | - Prefer coarse tags (not overly detailed) |
| | - Keeps the same language as input (Korean -> Korean, English -> English) |
| | - Avoids underscores `_` |
| |
|
| | > In production, parse only the first JSON array `[ ... ]` from the output. |
| |
|
| | ## Quick usage (Transformers) |
| |
|
| | ```python |
| | import json, re, torch |
| | from transformers import AutoTokenizer, AutoModelForCausalLM |
| | |
| | MODEL_DIR = "./" # or your HF repo id |
| | |
| | tok = AutoTokenizer.from_pretrained(MODEL_DIR, trust_remote_code=True) |
| | if tok.pad_token is None: |
| | tok.pad_token = tok.eos_token |
| | |
| | model = AutoModelForCausalLM.from_pretrained( |
| | MODEL_DIR, torch_dtype="auto", device_map="cuda", trust_remote_code=True |
| | ) |
| | |
| | def extract_array(s: str): |
| | m = re.search(r"\[[\s\S]*?\]", s) |
| | if not m: |
| | return None |
| | return json.loads(m.group(0)) |
| | |
| | text = "์ค๋ ์์ธ์์ AI ์ปจํผ๋ฐ์ค๋ฅผ ๋ค๋
์๋ค." |
| | messages = [ |
| | {"role": "system", "content": "๋๋ ํ๊ทธ ์์ฑ๊ธฐ๋ค. ์ถ๋ ฅ์ JSON ๋ฐฐ์ด ํ๋๋ง."}, |
| | {"role": "user", "content": f"๋ฌธ์ฅ: {text}\nํ๊ทธ 3~10๊ฐ. ๋๋ฌด ๋ํ
์ผํ์ง ์๊ฒ. ์ธ๋์ค์ฝ์ด ๊ธ์ง. JSON ๋ฐฐ์ด๋ง."}, |
| | ] |
| | |
| | prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) |
| | enc = tok(prompt, return_tensors="pt").to("cuda") |
| | |
| | out = model.generate(**enc, max_new_tokens=64, do_sample=False) |
| | decoded = tok.decode(out[0], skip_special_tokens=True) |
| | print(extract_array(decoded)) |
| | ``` |
| |
|
| | Notes |
| | โข Some outputs may include extra tokens (e.g., <think>). In production, extract only the first JSON array [ ... ]. |
| | โข Training data is intended to avoid sensitive information. |
| | |
| | Credits |
| | โข Base model: Qwen/Qwen3-0.6B |
| | โข Project: Float-Right |