Views
No views yet
Intelligence, Distilled.
3f744d01)1# Example: Running your Sovereign Model
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_id = "smolify/smolified-truenorth"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
7
8messages = [
9 {"role": "system", "content": '''The user is a Class 9 student. Perform a multidimensional analysis across RIASEC profiles, cognitive traits, and extracurricular engagement to predict their optimal career evolution.'''},
10 {"role": "user", "content": '''{"grade_band":"Class 9","examinations":{"orientation_style":{"text":"Student chose (A) 'Artist' and (A) 'Architecture of dreams'. Interested in designing smart city interiors using modular sustainable components. Loves SketchUp and Blender.","score_summary":{"dominant_category":"A"}},"interest_assessment":{"text":"Strong preference for aesthetics in daily utility tools. Obsessed with minimalist design and efficient layout management in crowded environments."}},"assessments":{"personality_assessment":{"text":"Enjoys visual storytelling. Finds peace in sketching urban layouts. Social skills: reserved but thrives in creative collaborations. Aptitude: High in Spatial visualization."},"aptitude_highlights":{"text":"Exceptional scores in spatial reasoning, block rotation, and conceptual pattern finding."}},"onboarding":{"interests":["architecture","design","sustainable-living"],"strengths":["visual-spatial","attention-to-detail","innovation"],"favoriteSubject":"Art","dreamJob":"Sustainable Architect"},"profile":{"fullName":"Meera Das","bio":"A young visionary from Kolkata sketching cities of the future.","shortTermGoal":"Learn AutoCAD foundation."}}'''}
11]
12text = tokenizer.apply_chat_template(
13 messages,
14 tokenize = False,
15 add_generation_prompt = True,
16)
17if "qwen-3.5-0.8b" == "gemma-3-270m":
18 text = text.removeprefix('<bos>')
19
20from transformers import TextStreamer
21_ = model.generate(
22 **tokenizer(text, return_tensors = "pt").to(model.device),
23 max_new_tokens = 1000,
24 temperature = 1.0, top_p = 0.95, top_k = 64,
25 streamer = TextStreamer(tokenizer, skip_prompt = True),
26)