Downloads · 30 days
0
ytakaba77tmc/llm-jp-3-13b-finetune-yuta_takaba
llm-jp-3-13b-finetune-yuta_takaba is a machine learning model from ytakaba77tmc. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
- Developed by: [Yuta Takaba] - Model type: [NLP] - Language(s) (NLP): [Japanese] - License: [More Information Needed] - Finetuned from model [optional]: [llm-jp-3-13b]
Downloads · 30 days
0
Access
Public
Updated Dec 17, 2024
Repo size
250 MB
Likes
1
Public
Click a slice to open those files.
.safetensors250 MB · 98%
From the Hugging Face model README
This model can be used on Jupyterlab.
from tqdm import tqdm
results = []
for data in tqdm(datasets):
input = data["input"]
prompt = f"""### 指示
{input}
### 回答
"""
tokenized_input = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)
attention_mask = torch.ones_like(tokenized_input)
with torch.no_grad():
outputs = model.generate(
tokenized_input,
attention_mask=attention_mask,
max_new_tokens=100,
do_sample=False,
repetition_penalty=1.2,
pad_token_id=tokenizer.eos_token_id
)[0]
output = tokenizer.decode(outputs[tokenized_input.size(1):], skip_special_tokens=True)
results.append({"task_id": data["task_id"], "input": input, "output": output})