Downloads · 30 days
129
8% of all-time downloads
RichardErkhov/bigdefence_-_Llama-3.1-8B-Ko-bigdefence-gguf
bigdefence_-_Llama-3.1-8B-Ko-bigdefence-gguf is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
129
8% of all-time downloads
All-time downloads
1.6K
Public
Repo size
92.9 GB
Likes
0
Public
Click a slice to open those files.
.gguf108 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
Llama-3.1-8B-Ko-bigdefence - GGUF
base_model: meta-llama/Meta-Llama-3.1-8B language:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
base_model = 'bigdefence/Llama-3.1-8B-Ko-bigdefence'
device = 'cuda' if torch.cuda.is_available() else 'cpu'
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.float16, device_map="auto")
model.eval()
def generate_response(prompt, model, tokenizer, text_streamer,max_new_tokens=256):
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=True)
inputs = inputs.to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
streamer=text_streamer,
max_new_tokens=max_new_tokens,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response.replace(prompt, '').strip()
key = "안녕?"
prompt = f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{key}
### Response:
"""
text_streamer = TextStreamer(tokenizer)
response = generate_response(prompt, model, tokenizer,text_streamer)
print(response)
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.