Downloads · 30 days
19
24% of all-time downloads
iamjry/ai-basic-law-ministral8b
ai-basic-law-ministral8b is a text generation model from iamjry. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-4.0.
基於 Ministral-8B-Instruct-2410 微調的台灣「人工智慧基本法」問答模型。
Downloads · 30 days
19
24% of all-time downloads
All-time downloads
78
Public
Parameters
8B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16 GB · 100%
From the Hugging Face model README
基於 Ministral-8B-Instruct-2410 微調的台灣「人工智慧基本法」問答模型。
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "iamjry/ai-basic-law-ministral8b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.float16, device_map="auto"
)
system_prompt = "你是一位熟悉台灣人工智慧基本法的法律助理,請根據法條內容精確回答問題。"
question = "請列出人工智慧基本法第3條全文"
messages = [{"role": "user", "content": f"{system_prompt}\n\n{question}"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=500, repetition_penalty=1.3, do_sample=False)
generated = outputs[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
See ai-basic-law-ministral8b-GGUF for quantized GGUF versions.
| Category | Description |
|---|---|
| Article Fulltext | Verbatim text of all 20 articles with topic anchors |
| Alias Recognition | 「基本法」「AI基本法」→ 人工智慧基本法 |
| Legislative Reasons | Background and rationale for each article |
| Taiwan Context | Anti-hallucination data to prevent confusion with Chinese laws |
| Publication Date | 民國115年(2026年)1月14日, 華總一義字第11500001671號令 |
你是一位熟悉台灣人工智慧基本法的法律助理,請根據法條內容精確回答問題。CC-BY-4.0