Upload 137 files
Browse files- hugging/td_fuse/validate.py +2 -4
- hugging/td_lang/compiler.py +21 -1
hugging/td_fuse/validate.py
CHANGED
|
@@ -217,10 +217,8 @@ def test_thinking_mode(
|
|
| 217 |
with torch.no_grad():
|
| 218 |
outputs = model.generate(
|
| 219 |
**inputs,
|
| 220 |
-
max_new_tokens=
|
| 221 |
-
do_sample=
|
| 222 |
-
temperature=0.7,
|
| 223 |
-
top_p=0.9,
|
| 224 |
)
|
| 225 |
|
| 226 |
# Decode only the NEW tokens (skip the prompt)
|
|
|
|
| 217 |
with torch.no_grad():
|
| 218 |
outputs = model.generate(
|
| 219 |
**inputs,
|
| 220 |
+
max_new_tokens=800,
|
| 221 |
+
do_sample=False,
|
|
|
|
|
|
|
| 222 |
)
|
| 223 |
|
| 224 |
# Decode only the NEW tokens (skip the prompt)
|
hugging/td_lang/compiler.py
CHANGED
|
@@ -1011,6 +1011,10 @@ DO NOT EDIT - regenerate from the .td file instead.
|
|
| 1011 |
self._emit(' "Provide a formal argument for: {problem}"],')
|
| 1012 |
self._emit('"factual": ["Answer with citations: {problem}",')
|
| 1013 |
self._emit(' "List 3 verified facts about: {problem}"],')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1014 |
self._indent -= 1
|
| 1015 |
self._emit("}")
|
| 1016 |
self._emit("")
|
|
@@ -1053,6 +1057,22 @@ DO NOT EDIT - regenerate from the .td file instead.
|
|
| 1053 |
self._emit("'What causes tides on Earth?',")
|
| 1054 |
self._indent -= 1
|
| 1055 |
self._emit("],")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1056 |
self._indent -= 1
|
| 1057 |
self._emit("}")
|
| 1058 |
self._emit("")
|
|
@@ -1097,7 +1117,7 @@ DO NOT EDIT - regenerate from the .td file instead.
|
|
| 1097 |
self._indent += 1
|
| 1098 |
self._emit("domain = random.choice(weak_topics)")
|
| 1099 |
self._emit("problem = make_problem(domain)")
|
| 1100 |
-
self._emit("template = random.choice(domain_templates
|
| 1101 |
self._emit('prompt = template.format(problem=problem)')
|
| 1102 |
self._emit('inputs = tok(prompt, return_tensors="pt").to(model.device)')
|
| 1103 |
self._emit("with torch.no_grad():")
|
|
|
|
| 1011 |
self._emit(' "Provide a formal argument for: {problem}"],')
|
| 1012 |
self._emit('"factual": ["Answer with citations: {problem}",')
|
| 1013 |
self._emit(' "List 3 verified facts about: {problem}"],')
|
| 1014 |
+
self._emit('"creativity": ["Think of an original approach to: {problem}",')
|
| 1015 |
+
self._emit(' "Brainstorm 5 creative solutions for: {problem}"],')
|
| 1016 |
+
self._emit('"instruction": ["Follow these instructions precisely: {problem}",')
|
| 1017 |
+
self._emit(' "Complete this task exactly as described: {problem}"],')
|
| 1018 |
self._indent -= 1
|
| 1019 |
self._emit("}")
|
| 1020 |
self._emit("")
|
|
|
|
| 1057 |
self._emit("'What causes tides on Earth?',")
|
| 1058 |
self._indent -= 1
|
| 1059 |
self._emit("],")
|
| 1060 |
+
self._emit("'creativity': [")
|
| 1061 |
+
self._indent += 1
|
| 1062 |
+
self._emit("'Design a new board game that teaches fractions to kids',")
|
| 1063 |
+
self._emit("'Invent a product that solves a common kitchen problem',")
|
| 1064 |
+
self._emit("'Write a short story where time flows backwards',")
|
| 1065 |
+
self._emit("'Propose 3 unconventional uses for a paperclip',")
|
| 1066 |
+
self._indent -= 1
|
| 1067 |
+
self._emit("],")
|
| 1068 |
+
self._emit("'instruction': [")
|
| 1069 |
+
self._indent += 1
|
| 1070 |
+
self._emit("'Write exactly 3 sentences about dogs. Each must start with a different letter.',")
|
| 1071 |
+
self._emit("'List the planets in order from the sun. Format each as: N. Name - one interesting fact.',")
|
| 1072 |
+
self._emit("'Translate this to formal English then to casual English: gonna grab some grub',")
|
| 1073 |
+
self._emit("'Summarize photosynthesis in exactly 25 words.',")
|
| 1074 |
+
self._indent -= 1
|
| 1075 |
+
self._emit("],")
|
| 1076 |
self._indent -= 1
|
| 1077 |
self._emit("}")
|
| 1078 |
self._emit("")
|
|
|
|
| 1117 |
self._indent += 1
|
| 1118 |
self._emit("domain = random.choice(weak_topics)")
|
| 1119 |
self._emit("problem = make_problem(domain)")
|
| 1120 |
+
self._emit("template = random.choice(domain_templates.get(domain, ['Solve this problem step by step: {problem}']))")
|
| 1121 |
self._emit('prompt = template.format(problem=problem)')
|
| 1122 |
self._emit('inputs = tok(prompt, return_tensors="pt").to(model.device)')
|
| 1123 |
self._emit("with torch.no_grad():")
|