--- license: apache-2.0 language: ja library_name: transformers tags: - continued-pretraining - language-model model-index: - name: aokitools/japanese-laws-egov-instruct-202508182216 results: [] --- # Experimental model in research stage ## Quickstart If you're using [Ollama](https://ollama.com/), run the following command first, then restart the Ollama app and select the newly added model. ```shell ollama pull hf.co/aokitools/japanese-laws-egov-instruct-202508182216 ``` If you want to remove it, run the following command: ```shell ollama list ollama rm hf.co/aokitools/japanese-laws-egov-instruct-202508182216:latest ollama list ``` To use it from Python, use the following code. ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig model_name = "aokitools/japanese-laws-egov-instruct-202508182216" quant_config = BitsAndBytesConfig( load_in_8bit=True, llm_int8_threshold=6.0, ) # load the tokenizer and the model tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype=torch.float16, device_map="auto", quantization_config=quant_config, ) # prepare the model input prompt = "Give me a short introduction to large language model." messages = [ {"role": "user", "content": prompt} ] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, enable_thinking=True # Switches between thinking and non-thinking modes. Default is True. ) model_inputs = tokenizer([text], return_tensors="pt").to(model.device) # conduct text completion generated_ids = model.generate( **model_inputs, max_new_tokens=256 ) output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() # parsing thinking content try: # rindex finding 151668 () index = len(output_ids) - output_ids[::-1].index(151668) except ValueError: index = 0 thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n") content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n") print("thinking content:", thinking_content) print("content:", content) ``` This model is a continual pretraining of [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B). ## Training details - Base model: Qwen3-1.7B - Tokenizer: QwenTokenizer ## License - Apache 2.0 + Alibaba Qianwen License