library_name: transformers
license: apache-2.0
Model Card for Model ID
Model Details
This Model fine-tuned by Security dataset. I will fine-tune continuous...
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: [More Information Needed]
- Funded by [optional]: [More Information Needed]
- Shared by [optional]: [More Information Needed]
- Model type: [More Information Needed]
- Language(s) (NLP): [More Information Needed]
- License: [More Information Needed]
- Finetuned from model [optional]: [More Information Needed]
Model Sources [optional]
- Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
import os
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
model_id = 'model_result'
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
model_id,
#torch_dtype=torch.bfloat16,
quantization_config=bnb_config, # 4-bit quantization (4λΉνΈ μμν)
device_map="auto",
)
model.eval()
from transformers import TextStreamer
def inference(input: str):
streamer = TextStreamer(tokenizer=tokenizer, skip_prompt=True, skip_special_tokens=True)
messages = [
{"role": "system", "content": "You are an information security AI assistant. Information security questions must be answered accurately."},
{"role": "user", "content": f"Please provide concise, non-repetitive answers to the following questions:\n {input}"}
# {"role": "user", "content": f"{input}"}
]
input_ids = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
input_ids,
streamer=streamer,
max_new_tokens=8192,
num_beams=1,
do_sample=True,
temperature=0.1,
top_p=0.95,
top_k=10
)
inference("ν΄νΉ λΉνμ§ μμΌλ €λ©΄ μ΄λ»κ² ν΄μΌνλμ§ μλ €μ€.")
ν΄νΉ λΉνμ§ μμΌλ €λ©΄ λ€μκ³Ό κ°μ κ²λ€μ κ³ λ €ν΄ λ³΄μΈμ:
1. **ν¨μ€μλ κ΄λ¦¬**: κ°λ ₯ν ν¨μ€μλλ₯Ό μ¬μ©νκ³ , ν¨μ€μλμ 볡μ‘μ±κ³Ό λ³ν μ£ΌκΈ°λ₯Ό μ μ μ§νμΈμ.
2. **μμ€ν
μ
λ°μ΄νΈ**: μ΅μ μννΈμ¨μ΄μ 보μ ν¨μΉλ₯Ό μ€μΉνκ³ , μ§μμ μΌλ‘ μμ€ν
μ μ
λ°μ΄νΈνμΈμ.
3. **μ€μΊ λ° κ²μ¬**: μμ€ν
κ³Ό λ€νΈμν¬λ₯Ό μμ£Ό μ€μΊνκ³ , 보μ μ·¨μ½μ μ κ²μ¬ν΄ 보μΈμ.
4. **μμ ν λΈλΌμ°μ§**: μμ ν λΈλΌμ°μ μ νμ₯ κΈ°λ₯μ μ¬μ©νκ³ , μ
μ± μννΈμ¨μ΄ μ€μΉλ₯Ό λ°©μ§νμΈμ.
5. **λ°μ΄ν° λ°±μ
**: μ€μν λ°μ΄ν°λ₯Ό λ°±μ
νκ³ , μ΄λ₯Ό μμ ν μ μ₯μμ 보κ΄νμΈμ.
6. **λ€νΈμν¬ λ³΄μ**: λ€νΈμν¬ λ³΄μ μ₯λΉλ₯Ό μ¬μ©νκ³ , μΉ¨μ
μμ λν ν΅μ μ κ°μλ₯Ό μ μ§νμΈμ.
7. **μ¬μ©μ κ΅μ‘**: μ¬μ©μλ€μ΄ μμ ν μ¬μ© λ°©λ²μ μ΄ν΄νκ³ , μ 보 보μμ λν μ€μμ±μ μΈμ§νμΈμ.
8. **κ³μ½μ κ΄λ¦¬**: κ³μ½μμ ννΈλμμ κ³μ½μ μ νμΈνκ³ , μ 보 보μμ λν ν©μλ₯Ό μ μ§νμΈμ.
Direct Use
[More Information Needed]
Downstream Use [optional]
[More Information Needed]
Out-of-Scope Use
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
[More Information Needed]
Training Details
Training Data
[More Information Needed]
Training Procedure
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed]
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]