This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import llama_cpp | |
| import re | |
| import json | |
| # Model configuration | |
| # tested with mistral, llama2, llama3, and phi3 | |
| model_path = "/path/to/model" | |
| base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # This is a really simple implementation of ELA as described in | |
| # http://blackhat.com/presentations/bh-dc-08/Krawetz/Whitepaper/bh-dc-08-krawetz-WP.pdf | |
| # You shouldn't actually use it, or at least read the paper carefully | |
| # and implement more of the techniques before drawing any conclusions. | |
| from PIL import Image, ImageChops, ImageEnhance | |
| import sys, os.path |