Text Classification
Laya
Safetensors
system-one
reverse-engineering
x86-64
assembly
windows-api
static-analysis
Instructions to use ntraidmode/laya-x64-v4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use ntraidmode/laya-x64-v4 with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download ask.py from ntraidmode/laya-x64-v4: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/ntraidmode/laya-x64-v4/resolve/main/ask.py
- Command line
-
hf download hf://ntraidmode/laya-x64-v4/ask.py
-
curl -L -o ask.py https://huggingface.co/ntraidmode/laya-x64-v4/resolve/main/ask.py
1.33 kB
| import argparse | |
| import json | |
| from laya_x64 import DEFAULT_MODEL, Analyzer | |
| def describe(value): | |
| if isinstance(value, dict): | |
| return f"{value['answer']} ({value['p']:.0%} sure)" | |
| answer = "yes" if value >= 0.5 else "no" | |
| confidence = max(value, 1 - value) | |
| note = " <- unsure" if confidence < 0.8 else "" | |
| return f"{answer} ({confidence:.0%} sure){note}" | |
| def main(): | |
| ap = argparse.ArgumentParser(description="Ask the x64-trained Laya model about instructions.") | |
| ap.add_argument("instructions", nargs="+", help='Intel syntax, e.g. "pdep rax, rbx, rcx"') | |
| ap.add_argument("--model", default=DEFAULT_MODEL) | |
| ap.add_argument("--full", action="store_true", help="also ask per-flag and per-register questions") | |
| ap.add_argument("--json", action="store_true", help="print raw probabilities (noul = probability of yes)") | |
| args = ap.parse_args() | |
| analyzer = Analyzer(args.model) | |
| for text in args.instructions: | |
| answers = analyzer.ask(text, full=args.full) | |
| print(f"\n{text}") | |
| if args.json: | |
| print(json.dumps(answers, indent=2)) | |
| continue | |
| width = max(len(k) for k in answers) | |
| for question, value in answers.items(): | |
| print(f" {question:<{width}} {describe(value)}") | |
| if __name__ == "__main__": | |
| main() | |