Edit model card

suarkadipa/GPT-2-finetuned-medical-domain

This model is a fine-tuned version of distilgpt2 on an argilla/medical-domain dataset. Based on https://python.plainenglish.io/i-fine-tuned-gpt-2-on-100k-scientific-papers-heres-the-result-903f0784fe65

It achieves the following results on the evaluation set:

  • Train Loss: 2.5822
  • Validation Loss: 2.1133
  • Epoch: 0

Model description

More information needed

Intended uses & limitations

How to run in Google Colab

from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer_fromhub = AutoTokenizer.from_pretrained("suarkadipa/GPT-2-finetuned-papers")
model_fromhub = AutoModelForCausalLM.from_pretrained("suarkadipa/GPT-2-finetuned-papers", from_tf=True)

text_generator = pipeline(
    "text-generation",
    model=model_fromhub,
    tokenizer=tokenizer_fromhub,
    framework="tf",
    max_new_tokens=3000
)

test_sentence = "the lungs"
res=text_generator(test_sentence)[0]["generated_text"].replace("\n", " ")

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • optimizer: {'name': 'AdamWeightDecay', 'learning_rate': {'class_name': 'ExponentialDecay', 'config': {'initial_learning_rate': 0.0005, 'decay_steps': 500, 'decay_rate': 0.95, 'staircase': False, 'name': None}}, 'decay': 0.0, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False, 'weight_decay_rate': 0.01}
  • training_precision: float32

Training results

Train Loss Validation Loss Epoch
2.5822 2.1133 0

Framework versions

  • Transformers 4.29.2
  • TensorFlow 2.12.0
  • Datasets 2.12.0
  • Tokenizers 0.13.3
Downloads last month
8

Dataset used to train suarkadipa/GPT-2-finetuned-medical-domain