Run this model with HF Jobs
Run deepcode-ai/Prompt-Injection-LLM01 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/deepcode-ai/Prompt-Injection-LLM01. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/deepcode-ai/Prompt-Injection-LLM01 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use deepcode-ai/Prompt-Injection-LLM01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use deepcode-ai/Prompt-Injection-LLM01 with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("<base-model-id>") model.load_adapter("deepcode-ai/Prompt-Injection-LLM01", set_active=True) - Notebooks
- Google Colab
- Kaggle
Create utils.py
Browse files123456789101112131415161718192021222324252627282930313233343536373839import osimport picklefrom tqdm import tqdmfrom typing import Listimport pandas as pdfrom prompt_injection.evaluators.base import PromptEvaluator
def init_evaluator_result_object(output_path,evaluator_list): result={'idx':[],'Prompt':[]} if os.path.exists(output_path): with open(output_path,'rb') as f: result=pickle.load(f)
if os.path.exists(output_path): with open(output_path,'rb') as f: result=pickle.load(f)
for evaluator in evaluator_list: result[evaluator.get_name()]=result.get(evaluator.get_name(),[])
return result
def evaluate_all(prompts,evaluator_list:List[PromptEvaluator],output_path): result=init_evaluator_result_object(output_path,evaluator_list)
for i in tqdm(range(len(prompts))): if i in result["idx"]: continue
prompt=prompts[i] result['idx'].append(i) result['Prompt'].append(prompt) for evaluator in evaluator_list: result[evaluator.get_name()].append(evaluator.eval_sample(prompt))
with open(output_path,'wb') as f: pickle.dump(result, f, protocol=pickle.HIGHEST_PROTOCOL) return pd.DataFrame.from_dict(result)prompt_injection/evaluators/utils.pyAdded+39