Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| TinyGPT2-81M.Q2_K.gguf | Q2_K | 0.06GB |
| TinyGPT2-81M.IQ3_XS.gguf | IQ3_XS | 0.06GB |
| TinyGPT2-81M.IQ3_S.gguf | IQ3_S | 0.06GB |
| TinyGPT2-81M.Q3_K_S.gguf | Q3_K_S | 0.06GB |
| TinyGPT2-81M.IQ3_M.gguf | IQ3_M | 0.07GB |
| TinyGPT2-81M.Q3_K.gguf | Q3_K | 0.07GB |
| TinyGPT2-81M.Q3_K_M.gguf | Q3_K_M | 0.07GB |
| TinyGPT2-81M.Q3_K_L.gguf | Q3_K_L | 0.07GB |
| TinyGPT2-81M.IQ4_XS.gguf | IQ4_XS | 0.07GB |
| TinyGPT2-81M.Q4_0.gguf | Q4_0 | 0.07GB |
| TinyGPT2-81M.IQ4_NL.gguf | IQ4_NL | 0.07GB |
| TinyGPT2-81M.Q4_K_S.gguf | Q4_K_S | 0.07GB |
| TinyGPT2-81M.Q4_K.gguf | Q4_K | 0.08GB |
| TinyGPT2-81M.Q4_K_M.gguf | Q4_K_M | 0.08GB |
| TinyGPT2-81M.Q4_1.gguf | Q4_1 | 0.08GB |
| TinyGPT2-81M.Q5_0.gguf | Q5_0 | 0.08GB |
| TinyGPT2-81M.Q5_K_S.gguf | Q5_K_S | 0.08GB |
| TinyGPT2-81M.Q5_K.gguf | Q5_K | 0.09GB |
| TinyGPT2-81M.Q5_K_M.gguf | Q5_K_M | 0.09GB |
| TinyGPT2-81M.Q5_1.gguf | Q5_1 | 0.09GB |
| TinyGPT2-81M.Q6_K.gguf | Q6_K | 0.09GB |
| TinyGPT2-81M.Q8_0.gguf | Q8_0 | 0.12GB |
import torch
from transformers import GPT2LMHeadModel, GPT2Tokenizer
# Load fine-tuned GPT-2 model and tokenizer
model = GPT2LMHeadModel.from_pretrained("AIGym/TinyGPT2-81M-colab") # or change the name to the checkpoint if you wanted to try them out
tokenizer = GPT2Tokenizer.from_pretrained("AIGym/TinyGPT2-81M-colab") # use the same as the one above unless you know what you are doing
# Example prompts
prompts = [
"Artificial intelligence is",
"The future of humanity depends on",
"In a galaxy far, far away, there lived",
"To be or not to be, that is",
"Once upon a time, there was a"
]
# Function to generate text based on a prompt
def generate_text(prompt, max_length=120, temperature=0.3):
input_ids = tokenizer.encode(prompt, return_tensors="pt")
attention_mask = torch.ones(input_ids.shape, dtype=torch.long)
output = model.generate(input_ids, attention_mask=attention_mask, max_length=max_length, temperature=temperature, num_return_sequences=1)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
return generated_text
# Generate and print completions for each prompt
for prompt in prompts:
completion = generate_text(prompt)
print("Prompt:", prompt)
print("Completion:", completion)
print()