Download scripts/make_demo_data.py from devildasdf/NEXORA: direct link, hf CLI and curl.
- Browser
- Download file 2.91 kB
-
https://huggingface.co/devildasdf/NEXORA/resolve/main/scripts/make_demo_data.py
- Command line
-
hf download hf://devildasdf/NEXORA/scripts/make_demo_data.py
-
curl -L -o make_demo_data.py https://huggingface.co/devildasdf/NEXORA/resolve/main/scripts/make_demo_data.py
2.91 kB
| """Generate original synthetic lab text. Not a foundation-model corpus.""" | |
| from pathlib import Path | |
| import json | |
| def main(): | |
| rows = [] | |
| facts = [ | |
| ("code", "A reliable program checks its inputs, handles errors, and returns a well-defined result."), | |
| ("code", "Python functions use indentation for blocks. A return statement supplies the result to the caller."), | |
| ("systems", "A database transaction groups changes. A rollback restores the state before an unsuccessful transaction."), | |
| ("systems", "A queue stores pending work. A bounded queue limits memory use when producers outpace consumers."), | |
| ("reasoning", "A hypothesis is a proposed explanation. Evidence can support it or reveal a contradiction."), | |
| ("math", "An even integer is divisible by two. The sum of two even integers is even."), | |
| ("tools", "A tool receipt records the observed result. A successful request is different from a verified task outcome."), | |
| ("privacy", "Personal memory should record its source and confidence. Records must support correction and deletion."), | |
| ("hindi", "यह एक छोटा प्रशिक्षण उदाहरण है। सही उत्तर देने से पहले उपलब्ध प्रमाण की जाँच करें।"), | |
| ("hinglish", "Code ko run karke output check karo. Agar test fail ho to error samjho aur phir repair karo."), | |
| ] | |
| for i, (domain, text) in enumerate(facts): | |
| rows.append({"id": f"original-{i}", "text": text, "domain": domain, "source": "nexora-original-synthetic-v1", "license": "owner-authored", "split": "train"}) | |
| for i in range(80): | |
| rows.append({"id": f"function-{i}", "text": f"def offset_{i}(value):\n \"\"\"Add the integer {i} to the input value.\"\"\"\n return value + {i}\n\nThe function offset_{i} maps 3 to {i+3}.", "domain": "code", "source": "nexora-original-synthetic-v1", "license": "owner-authored", "split": "train"}) | |
| for i, text in enumerate([ | |
| "Validation examples are separate from training examples. Their loss estimates next-token prediction on this small artificial domain only.", | |
| "A software test compares observed behavior with an expected result. Failed assertions identify differences that require investigation.", | |
| "def multiply(left, right):\n return left * right\n\nThe product of three and seven is twenty-one. Unicode round trips must preserve original input.", | |
| ]): | |
| rows.append({"id": f"validation-{i}", "text": text, "domain": "validation", "source": "nexora-original-synthetic-v1", "license": "owner-authored", "split": "validation"}) | |
| path = Path("examples/corpus.jsonl") | |
| path.parent.mkdir(exist_ok=True) | |
| path.write_text("".join(json.dumps(r, ensure_ascii=False)+"\n" for r in rows), encoding="utf-8") | |
| if __name__ == "__main__": | |
| main() | |