Downloads · 30 days
31
5% of all-time downloads
01GangaPutraBheeshma/colab_text_generation_FT_opt_on_dolly_UT_V2
colab_text_generation_FT_opt_on_dolly_UT_V2 is a text generation model from 01GangaPutraBheeshma. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
31
5% of all-time downloads
All-time downloads
568
Public
Parameters
331M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of facebook/opt-350m on argilla/databricks-dolly-15k.
Colab_text_generation_FT_opt_on_dolly_UT_V2 is an open-source language model, fine-tuned version of facebook/opt-350m and Supervised Finetuning was used to retrain and finetune the model - a strategy inspired by offline transfer reinforcement learning. This version of Model learn from mixed-quality data without preference labels, delivering exceptional performance. Despite the simple approach, my commitment is to develop a high-performance, commercially viable, open-source large language model, and I continue to make significant strides toward this vision.
The model, initially trained only on training data, serves multiple purposes such as generating prompts for downstream task evaluation and text generation. Furthermore, it can undergo fine-tuning for specific downstream tasks using the CLM (Causal Language Modeling) example.
The data on which this model was trained is argilla/databricks-dolly-15k-curated-en. Within this dataset, you'll discover a compilation of entries featuring a category, an instruction, a context, and a response corresponding to that instruction. The project's objective is to enhance the quality of instructions, inputs, and responses, ensuring they align seamlessly with their designated task category. All textual components should be articulate, providing genuine information. Additionally, responses should strive for completeness while maintaining conciseness.
category = "creative_writing"
instruction="Based on the following paragraph, what are some of the factors that are likely to influence gene expression in humans?"
prompt = f"""
### Category:
{category}
### Instruction:
{instruction}
### Context:
### Response:
"""
from transformers import AutoTokenizer, AutoModelForCausalLM
trained_tokenizer = AutoTokenizer.from_pretrained("01GangaPutraBheeshma/colab_text_generation_FT_opt_on_dolly_UT_V2")
trained_model = AutoModelForCausalLM.from_pretrained("01GangaPutraBheeshma/colab_text_generation_FT_opt_on_dolly_UT_V2")
input_ids = trained_tokenizer(prompt, return_tensors="pt", truncation=True).input_ids
# with torch.inference_mode():
print(f"After Training Response :")
outputs = trained_model.generate(input_ids=input_ids, max_new_tokens=1000, do_sample=True, top_p=0.9,temperature=1.0)
print(f"-------------------------\n\n")
print(f"Generated instruction:\n{trained_tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0][len(prompt):]}")
print(f"-------------------------\n\n")
The texts are tokenized using the GPT2 byte-level version of Byte Pair Encoding (BPE) (for unicode characters).
The 331M model was trained on Google Colab's A100 GPU. The training duration was roughly ~24 hours of continuous training.
The following hyperparameters were used during training: