SupraLabs/chat-titles-12K
Viewer β’ Updated β’ 11.9k β’ 141 β’ 3
Supra-Title-Flan-85M is a compact 85M-parameter seq2seq model built by SupraLabs, fine-tuned for automatic title generation from text passages. Created for product deploying really soon, Built on a T5-style encoder-decoder architecture and instruction-tuned in the Flan style, it takes a passage of text and produces a concise, relevant title.
This model is part of the SupraLabs open-source ecosystem alongside the Supra-50M causal series, but takes a different route: instead of next-token text generation, it focuses on structured text-to-text transformation.
| Parameter | Value |
|---|---|
| Architecture | T5ForConditionalGeneration |
| Parameters | ~85M |
d_model |
512 |
d_ff |
1024 |
d_kv |
64 |
| Encoder layers | 8 |
| Decoder layers | 8 |
| Attention heads | 6 |
| Max sequence length | 512 |
| Vocabulary size | 32,128 |
| Activation | Gated-GELU |
| Tokenizer | T5Tokenizer |
| Precision | float32 |
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
MODEL_ID = "SupraLabs/Supra-Title-Flan-85M"
tokenizer = T5Tokenizer.from_pretrained(MODEL_ID)
model = T5ForConditionalGeneration.from_pretrained(
MODEL_ID,
torch_dtype=torch.float32,
)
model.eval()
def generate_title(text: str, max_new_tokens: int = 32, num_beams: int = 4) -> str:
prompt = f"generate title: {text.strip()}"
inputs = tokenizer(
prompt,
return_tensors="pt",
max_length=512,
truncation=True,
)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
num_beams=num_beams,
early_stopping=True,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
text = """
The James Webb Space Telescope captured its deepest infrared image of the universe,
revealing thousands of galaxies, some dating back to just a few hundred million years
after the Big Bang.
"""
print(generate_title(text))
============================================================
GENERATED CHAT TITLES
============================================================
User-Prompt 1: Can you give me a recipe for a chocolate cake that doesn't use eggs?
Chat-Title 1 : Chocolate Cake Recipe
------------------------------------------------------------
User-Prompt 2: Explain the difference between a linear regression and a logistic regression model simply.
Chat-Title 2 : Linear regression and logistic regression
------------------------------------------------------------
User-Prompt 3: Write a python script that connects to an API and downloads JSON data.
Chat-Title 3 : Python Script for JSON Data
------------------------------------------------------------
User-Prompt 4: What are the top 5 tourist attractions in Tokyo, Japan?
Chat-Title 4 : Tokyo Tourist Locations
------------------------------------------------------------
User-Prompt 5: Translate the following sentence into Spanish: 'Where is the nearest train station?'
Chat-Title 5 : Translation To Spanish
------------------------------------------------------------
User-Prompt 6: How does photosynthesis work in plants? Explain step by step.
Chat-Title 6 : Photosynthesis in Plants
------------------------------------------------------------
User-Prompt 7: Help me write a professional email asking for a deadline extension on my project.
Chat-Title 7 : Project Date Extension Email
------------------------------------------------------------
User-Prompt 8: What is the capital of Australia and some quick facts about it?
Chat-Title 8 : Australia Capital Facts
------------------------------------------------------------
User-Prompt 9: Solve this math problem: if 3x + 5 = 20, what is the value of x?
Chat-Title 9 : Equation of x
------------------------------------------------------------
User-Prompt 10: Give me a short summary of the main plot of Shakespeare's Hamlet.
Chat-Title 10 : Shakespeare's Hamlet Summary
------------------------------------------------------------
User-Prompt 11: Bruh, my wifi keeps disconnecting the whole time last week π
Chat-Title 11 : Wireless Disconnecting Time
------------------------------------------------------------
Released under the Apache 2.0 License.