Fixed missing optional tags. Added default key value for Ollama (#12599)

Added missing Optional typings. Added default values for Ollama optional
keys.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Ackermann Yuriy
2023-10-31 12:30:10 +13:00
committed by GitHub
parent f6f3ca12e7
commit 99b69fe607
11 changed files with 55 additions and 41 deletions

View File

@@ -1,3 +1,5 @@
from typing import Optional
FULL_PROMPT = """# Context
- Plate-based data is rectangular and could be situated anywhere within the dataset.
- The first item in every row is the row index
@@ -54,7 +56,11 @@ AI_REPONSE_DICT = {
}
def create_prompt(num_plates: int | None, num_rows: int | None, num_cols: int | None):
def create_prompt(
num_plates: Optional[int] = None,
num_rows: Optional[int] = None,
num_cols: Optional[int] = None,
) -> str:
additional_prompts = []
if num_plates:
num_plates_str = f"are {num_plates} plates" if num_plates > 1 else "is 1 plate"