Skip to content

Commit 849b222

Browse files
Merge pull request #2 from ContextLab/claude/restructure-lectures-add-demos-4ntrv
Restructure lectures for Thursday X-hours and add 15 interactive web demos
2 parents 424ed87 + 6ce8fd9 commit 849b222

File tree

104 files changed

+37821
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+37821
-58
lines changed

.github/workflows/deploy-demos.yml

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
name: Deploy Demos to GitHub Pages
2+
3+
on:
4+
# Trigger on push to main branch
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'demos/**'
10+
- '.github/workflows/deploy-demos.yml'
11+
12+
# Allow manual trigger from Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions for GitHub Pages deployment
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: true
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
39+
- name: Validate HTML files
40+
run: |
41+
echo "Validating HTML structure..."
42+
# Check if index.html exists
43+
if [ ! -f "demos/index.html" ]; then
44+
echo "Error: demos/index.html not found"
45+
exit 1
46+
fi
47+
echo "HTML validation passed!"
48+
49+
- name: Check for broken links (basic)
50+
run: |
51+
echo "Checking for basic issues in demos..."
52+
# Simple check for common issues
53+
find demos -name "*.html" -type f | while read file; do
54+
echo "Checking: $file"
55+
# Check for basic HTML structure
56+
if ! grep -q "<!DOCTYPE html>" "$file"; then
57+
echo "Warning: $file missing DOCTYPE declaration"
58+
fi
59+
done
60+
61+
- name: Create build artifact
62+
run: |
63+
echo "Preparing demos for deployment..."
64+
mkdir -p _site
65+
cp -r demos/* _site/
66+
67+
# Create a .nojekyll file to bypass Jekyll processing
68+
touch _site/.nojekyll
69+
70+
# Create a custom 404 page
71+
cat > _site/404.html << 'EOF'
72+
<!DOCTYPE html>
73+
<html lang="en">
74+
<head>
75+
<meta charset="UTF-8">
76+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77+
<title>404 - Page Not Found</title>
78+
<style>
79+
body {
80+
margin: 0;
81+
padding: 0;
82+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
83+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
84+
color: white;
85+
display: flex;
86+
align-items: center;
87+
justify-content: center;
88+
min-height: 100vh;
89+
text-align: center;
90+
}
91+
.container {
92+
max-width: 600px;
93+
padding: 2rem;
94+
}
95+
h1 {
96+
font-size: 6rem;
97+
margin: 0;
98+
font-weight: 700;
99+
}
100+
p {
101+
font-size: 1.5rem;
102+
margin: 1rem 0 2rem;
103+
}
104+
a {
105+
display: inline-block;
106+
padding: 1rem 2rem;
107+
background: white;
108+
color: #667eea;
109+
text-decoration: none;
110+
border-radius: 8px;
111+
font-weight: 600;
112+
transition: transform 0.3s ease;
113+
}
114+
a:hover {
115+
transform: translateY(-2px);
116+
}
117+
</style>
118+
</head>
119+
<body>
120+
<div class="container">
121+
<h1>404</h1>
122+
<p>Oops! This demo doesn't exist yet.</p>
123+
<a href="/">Return to Demo Gallery</a>
124+
</div>
125+
</body>
126+
</html>
127+
EOF
128+
129+
echo "Build artifact created successfully!"
130+
131+
- name: List build contents
132+
run: |
133+
echo "Build directory structure:"
134+
ls -la _site/
135+
echo ""
136+
echo "Demos available:"
137+
find _site -type d -maxdepth 1 | sort
138+
139+
- name: Setup Pages
140+
uses: actions/configure-pages@v4
141+
142+
- name: Upload artifact
143+
uses: actions/upload-pages-artifact@v3
144+
with:
145+
path: '_site'
146+
147+
# Deployment job
148+
deploy:
149+
environment:
150+
name: github-pages
151+
url: ${{ steps.deployment.outputs.page_url }}
152+
runs-on: ubuntu-latest
153+
needs: build
154+
steps:
155+
- name: Deploy to GitHub Pages
156+
id: deployment
157+
uses: actions/deploy-pages@v4
158+
159+
- name: Display deployment URL
160+
run: |
161+
echo "🎉 Demos deployed successfully!"
162+
echo "📦 URL: ${{ steps.deployment.outputs.page_url }}"
163+
echo ""
164+
echo "Available demos:"
165+
echo "- Main Gallery: ${{ steps.deployment.outputs.page_url }}"
166+
echo "- ELIZA: ${{ steps.deployment.outputs.page_url }}01-eliza/"
167+
echo "- Tokenization: ${{ steps.deployment.outputs.page_url }}02-tokenization/"
168+
echo "- Embeddings: ${{ steps.deployment.outputs.page_url }}03-embeddings/"
169+
echo "- Attention: ${{ steps.deployment.outputs.page_url }}04-attention/"
170+
echo "- Transformer: ${{ steps.deployment.outputs.page_url }}05-transformer/"
171+
echo "- GPT Playground: ${{ steps.deployment.outputs.page_url }}06-gpt-playground/"
172+
173+
# Optional: Verify deployment
174+
verify:
175+
runs-on: ubuntu-latest
176+
needs: deploy
177+
steps:
178+
- name: Verify deployment
179+
run: |
180+
echo "Deployment verification complete!"
181+
echo "Demos should now be live at GitHub Pages."
182+
echo ""
183+
echo "To enable GitHub Pages:"
184+
echo "1. Go to repository Settings"
185+
echo "2. Navigate to Pages section"
186+
echo "3. Under 'Build and deployment', select 'GitHub Actions' as the source"
187+
echo "4. Save changes"

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ Welcome! This repository contains course materials for the Dartmouth undergradu
66
<img src="https://raw.githubusercontent.com/ContextLab/llm-course/main/admin/readme_robot.png" alt="robot" width="400"/>
77
</p>
88

9+
## 🎮 Interactive Web Demos
10+
11+
Learn by doing with our collection of **15 interactive web demonstrations** that bring NLP concepts to life! Each demo runs entirely in your browser with no installation required.
12+
13+
**🌐 Explore all demos:** [https://contextlab.github.io/llm-course/demos/](https://contextlab.github.io/llm-course/demos/)
14+
15+
### Featured Demos
16+
17+
- **[ELIZA Chatbot](https://contextlab.github.io/llm-course/demos/01-eliza/)** - Chat with the groundbreaking 1966 pattern-matching therapist and experience the ELIZA effect firsthand
18+
- **[Embeddings Visualization](https://contextlab.github.io/llm-course/demos/03-embeddings/)** - Explore word embeddings in interactive 3D space, rotate and zoom to discover semantic relationships
19+
- **[Transformer Explorer](https://contextlab.github.io/llm-course/demos/05-transformer/)** - Step through the transformer architecture layer by layer with real-time visualizations of attention, feedforward networks, and residual connections
20+
- **[Tokenization Explorer](https://contextlab.github.io/llm-course/demos/02-tokenization/)** - Compare BPE, WordPiece, and SentencePiece algorithms side-by-side
21+
- **[Attention Mechanism](https://contextlab.github.io/llm-course/demos/04-attention/)** - Watch attention weights update in real-time as you modify input sequences
22+
23+
### All Demos
24+
25+
Our complete collection covers: ELIZA, tokenization, embeddings, attention mechanisms, transformer architecture, GPT playground, RAG systems, topic modeling, sentiment analysis, POS tagging, word analogies, semantic search, BERT masked language modeling, embeddings comparison, and chatbot evolution. Browse the [demo collection](https://contextlab.github.io/llm-course/demos/) to explore them all!
26+
927
## A note about this Open Course
1028
This course is taught as an *Open Course*, meaning that the course is designed from the ground up to be shareable and freely accessible to anyone. All code for this course is written in [Python](https://www.python.org/) and most of the material is organized in [Jupyter notebooks](http://jupyter.org/).
1129

0 commit comments

Comments
 (0)