Text Classification
MLX
Safetensors
Laya
Polish
English
devops
decision-model
apple-silicon
experimental
synthetic-data
claude-code
litellm
Instructions to use tebebe/laya-devops-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tebebe/laya-devops-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download tebebe/laya-devops-mlx --local-dir laya-devops-mlx
- Laya
How to use tebebe/laya-devops-mlx 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
- Local Apps Settings
- LM Studio
- Atomic Chat
Download predict.py from tebebe/laya-devops-mlx: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/tebebe/laya-devops-mlx/resolve/main/predict.py
- Command line
-
hf download hf://tebebe/laya-devops-mlx/predict.py
-
curl -L -o predict.py https://huggingface.co/tebebe/laya-devops-mlx/resolve/main/predict.py
1.57 kB
| """Apply preprocessing and the frozen permission policy; never execute input.""" | |
| import argparse, json, os, sys | |
| from pathlib import Path | |
| ROOT=Path(__file__).resolve().parent | |
| sys.path.insert(0,str(ROOT/'runtime')) | |
| os.environ.setdefault('HF_HOME',str(ROOT/'.hf-cache')) | |
| os.environ['HF_HUB_OFFLINE']='1' | |
| def main(): | |
| parser=argparse.ArgumentParser();parser.add_argument('state',type=Path);args=parser.parse_args() | |
| from local_model_api import validate_state | |
| from input_preprocessing import load_preprocessor | |
| from operating_policy import load_allow_threshold | |
| from evaluate import decision | |
| from layastudio import engine | |
| import laya_mlx | |
| state=validate_state(json.loads(args.state.read_text())) | |
| prepare=load_preprocessor(json.loads((ROOT/'input-preprocessor.json').read_text())) | |
| state=prepare(state);engine.limit_mlx_cache();agent=laya_mlx.load(str(ROOT));questions=json.loads((ROOT/'questions.json').read_text()) | |
| prefix,_=engine.build_prefix(agent.tok,engine.internal_question(questions['permission']),agent.cfg['head_max_len']) | |
| room=agent.cfg['max_len']-len(prefix)-1 | |
| if len(agent.tok(engine.serialize_state(state).replace(agent.tok.mask_token,' '))['input_ids'])>room:raise ValueError('Input exceeds model context budget') | |
| p=agent.predict(state,questions)['answers']['permission']['probabilities'];threshold=load_allow_threshold(ROOT) | |
| print(json.dumps(dict(decision=decision(p,threshold),probabilities=p,allow_threshold=threshold,executed=False,benchmark_qualified=False),indent=2)) | |
| if __name__=='__main__':main() | |