Views
No views yet
1Model: Salesforce/codet5-small (60M parameters)
2Tokenizer: RobertaTokenizer
3Batch Size: 16
4Gradient Accumulation: 2 (effective batch size: 32)
5Learning Rate: 3e-4
6Weight Decay: 0.01
7Label Smoothing: 0.1
8Max Input Length: 640 tokens
9Max Output Length: 536 tokens1from transformers import RobertaTokenizer, T5ForConditionalGeneration
2import torch
3
4# Load model and tokenizer
5model_id = "dewyn/educraft-t5-function-call"
6tokenizer = RobertaTokenizer.from_pretrained(model_id)
7model = T5ForConditionalGeneration.from_pretrained(model_id)
8
9# Prepare input
10requirements = {
11 "title": "Machine Learning Fundamentals",
12 "domain": "computer_science",
13 "level": "intermediate",
14 "duration": "semester",
15 "description": "Introduction to machine learning algorithms and applications",
16 "learning_objectives": [
17 "Understand supervised learning algorithms",
18 "Implement neural networks",
19 "Evaluate model performance"
20 ]
21}
22
23import json
24input_text = f"Generate course syllabus: {json.dumps(requirements)}"
25
26# Generate function calls
27input_ids = tokenizer(
28 input_text,
29 return_tensors="pt",
30 max_length=640,
31 truncation=True,
32 padding=True
33).input_ids
34
35with torch.no_grad():
36 output = model.generate(
37 input_ids,
38 max_length=536,
39 num_beams=4,
40 early_stopping=False,
41 no_repeat_ngram_size=2,
42 )
43
44generated_code = tokenizer.decode(output[0], skip_special_tokens=True)
45print(generated_code)1# Machine Learning Fundamentals
2
3**Domain:** Computer Science
4**Level:** Intermediate
5**Duration:** Semester
6
7## Course Description
8Introduction to machine learning algorithms and applications
9
10## Learning Objectives
11- Understand supervised learning algorithms
12- Implement neural networks
13- Evaluate model performance
14
15## Modules
16
17### Module 1: Introduction to Machine Learning [0]
18**Duration:** 8 weeks
19
20### Module 2: Supervised Learning Algorithms [1]
21**Duration:** 12 weeks
22**Prerequisites:** Module 1
23
24### Module 3: Neural Networks [2]
25**Duration:** 16 weeks
26**Prerequisites:** Module 2
27
28## Activities
29- Hands-on ML Exercise [0] - Apply level
30- Neural Network Workshop [1] - Create level
31
32## Assessments
33- Final Project [0] - Project type1from scripts.markdown_syllabus_parser import MarkdownSyllabusParser
2
3# Parse generated markdown
4parser = MarkdownSyllabusParser(
5 modules_file="data/components/modules.json",
6 activities_file="data/components/activities.json",
7 assessments_file="data/components/assessments.json"
8)
9
10syllabus = parser.parse_markdown(generated_markdown)
11
12# Result is a complete syllabus dictionary with resolved components1@misc{codet5-syllabus-generator,
2 author = {EduCraft MSc AI Capstone Project},
3 title = {CodeT5 Function Call Generator for Educational Syllabus Creation},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{dewyn/educraft-t5-function-call}}
7}