Views
No views yet
google/reformer-enwik8 specifically adapted for domain name generation. It uses a pure tag-based approach where both content descriptors (e.g., "tech", "health") and style descriptors (e.g., "modern", "minimal") are treated as equal tags.tags: tag1;tag2;tag3 domain:tech, ai, startup, app, softwarehealth, wellness, fitness, medicaleco, green, sustainable, organicfashion, beauty, style, boutiquefood, restaurant, cafe, deliverymodern - Clean, contemporaryclassic - Traditional, timelessplayful - Fun, casualbold - Strong, impactfulelegant - Sophisticated, refinedtechy - Technical, digitaleco - Environmental, greenluxury - Premium, high-endminimal - Simple, shortcreative - Artistic, uniqueprofessional - Business-orientedcasual - Relaxed, informaltrendy - Current, fashionablesimple - Straightforwardunique - Distinctive1from transformers import ReformerModelWithLMHead, AutoTokenizer
2import torch
3
4# Load model
5model = ReformerModelWithLMHead.from_pretrained("humbleworth/reformer-character-domain-generator")
6model.eval()
7
8# Character encoding (Reformer standard)
9def encode_text(text):
10 return [c + 2 for c in text.encode('utf-8')]
11
12def decode_ids(ids):
13 return bytes([max(0, id - 2) for id in ids if id > 2]).decode('utf-8', errors='ignore')
14
15# Generate domain
16prompt = "tags: tech;startup;modern domain:"
17input_ids = torch.tensor([encode_text(prompt)])
18
19with torch.no_grad():
20 output = model.generate(
21 input_ids,
22 max_new_tokens=50,
23 temperature=1.2,
24 top_p=0.95,
25 do_sample=True,
26 pad_token_id=0,
27 eos_token_id=2
28 )
29
30generated = decode_ids(output[0].tolist())
31domain = generated.split("domain:")[-1].strip()
32print(f"Generated: {domain}")tags: tech;startup;ai → techflow.ai
tags: eco;sustainable;modern → greenleaf.eco
tags: health;wellness;minimal → purelife.health
tags: fashion;luxury;elegant → velvetrose.com
tags: food;delivery;playful → snackdash.io1@software{domain_generator_reformer,
2 title = {Domain Generator - Character-Level Reformer},
3 year = {2025},
4 publisher = {HuggingFace},
5 url = {https://huggingface.co/humbleworth/reformer-character-domain-generator}
6}