Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(model): Update Text-Generation Task Schema to Align with OpenAI Standards #69

Merged
merged 2 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions instill/helpers/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from enum import Enum
from typing import Any, Dict, Union
from typing import Any, Dict, List, Union

Check warning on line 3 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L3

Added line #L3 was not covered by tests

import numpy as np

Expand All @@ -23,11 +23,14 @@

class TextGenerationInput:
prompt = ""
prompt_images: Union[List[np.ndarray], None] = None
chat_history: Union[List[str], None] = None
system_message: Union[str, None] = None

Check warning on line 28 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L26-L28

Added lines #L26 - L28 were not covered by tests
max_new_tokens = 100
top_k = 1
temperature = 0.8
top_k = 1

Check warning on line 31 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L31

Added line #L31 was not covered by tests
random_seed = 0
stop_words: Any = ""
stop_words: Any = "" # Optional

Check warning on line 33 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L33

Added line #L33 was not covered by tests
extra_params: Dict[str, str] = {}


Expand All @@ -53,21 +56,28 @@


class TextGenerationChatInput:
conversation = ""
prompt = ""
prompt_images: Union[List[np.ndarray], None] = None
chat_history: Union[List[str], None] = None
system_message: Union[str, None] = None

Check warning on line 62 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L59-L62

Added lines #L59 - L62 were not covered by tests
max_new_tokens = 100
top_k = 1
temperature = 0.8
top_k = 1

Check warning on line 65 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L65

Added line #L65 was not covered by tests
random_seed = 0
stop_words: Any = "" # Optional

Check warning on line 67 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L67

Added line #L67 was not covered by tests
extra_params: Dict[str, str] = {}


class VisualQuestionAnsweringInput:
prompt_image: Union[np.ndarray, None] = None
prompt = ""
prompt_images: Union[List[np.ndarray], None] = None
chat_history: Union[List[str], None] = None
system_message: Union[str, None] = None

Check warning on line 75 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L73-L75

Added lines #L73 - L75 were not covered by tests
max_new_tokens = 100
top_k = 1
temperature = 0.8
top_k = 1

Check warning on line 78 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L78

Added line #L78 was not covered by tests
random_seed = 0
stop_words: Any = "" # Optional

Check warning on line 80 in instill/helpers/const.py

View check run for this annotation

Codecov / codecov/patch

instill/helpers/const.py#L80

Added line #L80 was not covered by tests
extra_params: Dict[str, str] = {}


Expand Down
Loading