mirror of
https://github.com/dongdongunique/EvoSynth.git
synced 2026-07-19 10:37:21 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, List, Dict
|
||||
from ..models.base_model import BaseModel
|
||||
|
||||
@dataclass
|
||||
class AttackResult:
|
||||
target: Any
|
||||
success: bool = False
|
||||
final_prompt: str = ""
|
||||
output_text: str = ""
|
||||
history: List[Dict[str, Any]] = field(default_factory=list)
|
||||
cost: Dict[str, float] = field(default_factory=dict)
|
||||
method: str = ""
|
||||
image_path: str = ""
|
||||
class BaseAttack(ABC):
|
||||
def __init__(self, model: BaseModel, **kwargs):
|
||||
self.model = model
|
||||
|
||||
@abstractmethod
|
||||
def attack(self, target: Any) -> AttackResult:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user