Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,18 +33,61 @@ support_level: "light" (1-2 steps), "medium" (3-4 steps), "high" (5 steps)"""
|
|
| 33 |
|
| 34 |
# ── Icon to emoji ──────────────────────────────────────────────────────────────
|
| 35 |
EMOJI = {
|
| 36 |
-
|
|
|
|
| 37 |
"read": "👁️", "eye": "👁️", "hand": "✋", "finger": "👆",
|
| 38 |
-
"talk": "🗣️", "listen": "👂", "think": "🧠", "look": "👁️",
|
| 39 |
"draw": "🎨", "paper": "📝", "notebook": "📓", "board": "📋",
|
| 40 |
"number": "🔢", "count": "🔢", "answer": "✅", "sort": "🗂️",
|
| 41 |
"match": "🔗", "circle": "⭕", "plant": "🌱", "seed": "🌰",
|
| 42 |
-
"water": "💧", "animal": "🐾", "picture": "🖼️", "
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
"
|
| 46 |
-
"
|
|
|
|
|
|
|
|
|
|
| 47 |
"science": "🔬", "maths": "➕", "english": "📚",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
def get_emoji(icon):
|
|
@@ -67,6 +110,7 @@ def generate_step_card(instruction, year, subject):
|
|
| 67 |
# Load model on first call (inside GPU context)
|
| 68 |
if model is None:
|
| 69 |
from unsloth import FastModel
|
|
|
|
| 70 |
model, tokenizer = FastModel.from_pretrained(
|
| 71 |
model_name=MODEL_ID,
|
| 72 |
max_seq_length=512,
|
|
|
|
| 33 |
|
| 34 |
# ── Icon to emoji ──────────────────────────────────────────────────────────────
|
| 35 |
EMOJI = {
|
| 36 |
+
# core actions
|
| 37 |
+
"book": "📖", "page": "📄", "pencil": "✏️", "write": "✏️", "writing": "✏️",
|
| 38 |
"read": "👁️", "eye": "👁️", "hand": "✋", "finger": "👆",
|
| 39 |
+
"talk": "🗣️", "listen": "👂", "think": "🧠", "look": "👁️", "show": "👁️",
|
| 40 |
"draw": "🎨", "paper": "📝", "notebook": "📓", "board": "📋",
|
| 41 |
"number": "🔢", "count": "🔢", "answer": "✅", "sort": "🗂️",
|
| 42 |
"match": "🔗", "circle": "⭕", "plant": "🌱", "seed": "🌰",
|
| 43 |
+
"water": "💧", "animal": "🐾", "picture": "🖼️", "image": "🖼️", "photo": "🖼️",
|
| 44 |
+
"partner": "👥", "find": "🔍", "search": "🔍", "observe": "🔭",
|
| 45 |
+
"measure": "📐", "ruler": "📏", "line": "📏",
|
| 46 |
+
"record": "📊", "bar": "📊", "label": "🏷️",
|
| 47 |
+
"colour": "🖌️", "color": "🖌️", "paintbrush": "🖌️",
|
| 48 |
+
"cut": "✂️", "touch": "👆", "quiet": "🤫", "ready": "✅", "check": "✅",
|
| 49 |
+
"open": "📂", "put": "📌", "place": "📌", "sit": "🪑", "chair": "🪑",
|
| 50 |
+
"carpet": "🪑", "desk": "🪑",
|
| 51 |
"science": "🔬", "maths": "➕", "english": "📚",
|
| 52 |
+
# people / social
|
| 53 |
+
"people": "👥", "two_people": "👥", "two-people": "👥", "friend": "👥",
|
| 54 |
+
"group": "👥", "class": "🏫", "classroom": "🏫", "pairs": "👥", "share": "👥",
|
| 55 |
+
# speech / thought
|
| 56 |
+
"pause": "⏸️", "ear": "👂", "speak": "🗣️", "discussion": "🗣️",
|
| 57 |
+
"buzz": "🗣️", "feedback": "💬", "speech_bubble": "💬", "speech-bubble": "💬",
|
| 58 |
+
"thought": "💭", "thought-bubble": "💭", "thought_bubble": "💭",
|
| 59 |
+
# writing tools
|
| 60 |
+
"marker": "🖊️", "pen": "🖊️", "highlighter": "🖊️", "eraser": "✏️",
|
| 61 |
+
"edit": "✏️", "underline": "📝", "sentence": "📝", "word": "📝",
|
| 62 |
+
"text": "📝", "paragraph": "📝", "title": "📝", "story": "📖",
|
| 63 |
+
# maths
|
| 64 |
+
"math": "➕", "equation": "➕", "plus": "➕", "add": "➕", "addend": "➕",
|
| 65 |
+
"divide": "➗", "calculator": "🔢", "blocks": "🧱", "build": "🧱",
|
| 66 |
+
"model": "🧱", "pattern": "🔢", "seven": "7️⃣",
|
| 67 |
+
# organising / tasks
|
| 68 |
+
"select": "👆", "choose": "👆", "pick": "👆",
|
| 69 |
+
"folder": "📁", "task": "📋", "tasks": "📋", "list": "📋", "work": "📋",
|
| 70 |
+
"fact": "📋", "options": "📋", "details": "📋", "rules": "📋",
|
| 71 |
+
"examples": "📋", "problem": "📋", "compare": "🔗", "checklist": "✅",
|
| 72 |
+
"solve": "✅", "questions": "❓", "question": "❓",
|
| 73 |
+
# ideas / feedback
|
| 74 |
+
"idea": "💡", "lightbulb": "💡", "decision": "💡",
|
| 75 |
+
# time / waiting
|
| 76 |
+
"wait": "⏳", "clock": "⏰", "repeat": "🔁", "play": "▶️",
|
| 77 |
+
# objects / materials
|
| 78 |
+
"box": "📦", "materials": "📦", "coat": "🧥", "wire": "🔌",
|
| 79 |
+
"cup": "🥛", "spoon": "🥄", "beaker": "🧪", "thermometer": "🌡️",
|
| 80 |
+
"worksheet": "📝", "homework": "📝", "exercise": "📝",
|
| 81 |
+
# nature / misc
|
| 82 |
+
"tree": "🌳", "blueberry": "🫐", "nightshade": "🌿", "garden": "🌱",
|
| 83 |
+
"cloud": "☁️", "fire": "🔥", "lightning": "⚡", "explosion": "💥",
|
| 84 |
+
"light": "💡", "breathe": "🌬️", "matter": "🔬",
|
| 85 |
+
# feedback / emotion
|
| 86 |
+
"thumb": "👍", "happy": "😊", "heart": "❤️",
|
| 87 |
+
# navigation
|
| 88 |
+
"door": "🚪", "broken": "❌", "close": "❌",
|
| 89 |
+
# misc
|
| 90 |
+
"marble": "⚪", "period": "📝", "photo": "🖼️",
|
| 91 |
}
|
| 92 |
|
| 93 |
def get_emoji(icon):
|
|
|
|
| 110 |
# Load model on first call (inside GPU context)
|
| 111 |
if model is None:
|
| 112 |
from unsloth import FastModel
|
| 113 |
+
global model, tokenizer
|
| 114 |
model, tokenizer = FastModel.from_pretrained(
|
| 115 |
model_name=MODEL_ID,
|
| 116 |
max_seq_length=512,
|