less than 1 minute read

Simulating/testing

Before diving into the project, I tested out gpt-2 using the pipeline method on Google Colab.

First, I installed all required libraries to run the model

pip install transformers datasets accelerate -q

Then, I ran a quick test to check whether confirm the program is running in colabs and the GPU (I selected T4 GPU for convenience) Screenshot 2025-07-07 at 3 16 24 PM

After that, I implemented a simple program to test gpt-2’s text generation, summarization, etc capabilities. Below is a snippet of the text generation code:

Screenshot 2025-07-07 at 3 19 49 PM

The model was able to properly generate texts according to the 3 given prompts

Screenshot 2025-07-07 at 3 21 42 PM Screenshot 2025-07-07 at 3 21 53 PM Screenshot 2025-07-07 at 3 22 09 PM

The model also produced confident responses for sentimental analysis, Q&A, and summarization.

Now that I have a good idea of how llms work, I will begin working on my project.