Downloads · 30 days
4
5% of all-time downloads
parseny/TinyLlama1.1B-Nvidia-QA
TinyLlama1.1B-Nvidia-QA is a text generation model from parseny. Use it when you need the model to write or continue text. It is set up for transformers.
This repository contains the parseny/TinyLlama1.1B-Nvidia-QA model, a fine-tuned version of the TinyLlama language model designed for generating answers on NVIDIA documentation. The model was fine-tuned on a dataset o…
Downloads · 30 days
4
5% of all-time downloads
All-time downloads
74
Public
Parameters
1.1B
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
This repository contains the parseny/TinyLlama1.1B-Nvidia-QA model, a fine-tuned version of the TinyLlama language model designed for generating answers on NVIDIA documentation. The model was fine-tuned on a dataset of question-answer pairs and evaluated using several metrics to ensure high performance.
The model was fine-tuned with the following training arguments:
training_arguments = TrainingArguments(
output_dir="./logs",
per_device_train_batch_size=16,
gradient_accumulation_steps=4,
optim="paged_adamw_32bit",
fp16=True,
evaluation_strategy="epoch",
save_strategy="epoch",
num_train_epochs=5,
load_best_model_at_end=True,
learning_rate=5e-4
)
The performance of the fine-tuned model was evaluated using the following metrics:
ROUGE Scores:
METEOR Score: 0.27
These scores indicate that the model performs reasonably well in generating responses that are lexically and semantically similar to the reference answers.
You can use this model to generate responses for chat-based applications. Below is an example of how to load and use the model for generating responses:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel, PeftConfig
import torch
# Load the model and tokenizer
model_id = "parseny/TinyLlama1.1B-Nvidia-QA"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
model.to('cuda')
# Generate a response
generation_config = GenerationConfig(
penalty_alpha=0.6, do_sample=True,
top_k=5, temperature=0.5, repetition_penalty=1.2,
max_new_tokens=47, pad_token_id=tokenizer.eos_token_id
)
def generate_response(prompt):
try:
inputs = tokenizer(prompt, return_tensors="pt").to('cuda')
outputs = model.generate(**inputs, generation_config=generation_config)
generated_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
start_idx = generated_response.find('<|im_start|>assistant\n') + len('<|im_start|>assistant\n')
generated_response = generated_response[start_idx:]
end_idx = generated_response.find('<|im_end|>')
generated_response = generated_response[:end_idx]
return generated_response
except:
return ""
# Example usage
prompt = "What was the purpose of setting up the DGX RAID memory in version 2 of the pipeline?"
response = generate_response(prompt)
print(response)
The model was fine-tuned using a dataset of question-answer pairs. The fine-tuning process involved:
SFTTrainer with the specified training arguments.If you use this model in your research or applications, please cite it as follows:
@misc{parseny-tinyllama-nvidia-qa,
author = {Your Name},
title = {TinyLlama1.1B-Nvidia-QA: NVIDIA documnetation helper},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/parseny/TinyLlama1.1B-Nvidia-QA},
}
For any questions or issues, please open an issue on the Hugging Face model repository.