Update dd.py
Browse files
dd.py
CHANGED
|
@@ -22,8 +22,8 @@ def format_text_input(prompts: List[str], system_message: str = None):
|
|
| 22 |
|
| 23 |
|
| 24 |
def get_mistral_3_small_prompt_embeds(
|
| 25 |
-
text_encoder:
|
| 26 |
-
tokenizer:
|
| 27 |
prompt: Union[str, List[str]],
|
| 28 |
max_sequence_length: int = 512,
|
| 29 |
system_message: str = """You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object
|
|
@@ -90,8 +90,8 @@ def prepare_text_ids(
|
|
| 90 |
|
| 91 |
|
| 92 |
def encode_prompt(
|
| 93 |
-
text_encoder:
|
| 94 |
-
tokenizer:
|
| 95 |
prompt: Union[str, List[str]],
|
| 96 |
num_images_per_prompt: int = 1,
|
| 97 |
prompt_embeds: Optional[torch.Tensor] = None,
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
def get_mistral_3_small_prompt_embeds(
|
| 25 |
+
text_encoder: AutoModelForCausalLM,
|
| 26 |
+
tokenizer: AutoTokenizer,
|
| 27 |
prompt: Union[str, List[str]],
|
| 28 |
max_sequence_length: int = 512,
|
| 29 |
system_message: str = """You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object
|
|
|
|
| 90 |
|
| 91 |
|
| 92 |
def encode_prompt(
|
| 93 |
+
text_encoder: AutoModelForCausalLM,
|
| 94 |
+
tokenizer: AutoTokenizer,
|
| 95 |
prompt: Union[str, List[str]],
|
| 96 |
num_images_per_prompt: int = 1,
|
| 97 |
prompt_embeds: Optional[torch.Tensor] = None,
|