Commit cf040ac5 authored by lintangsutawika's avatar lintangsutawika
Browse files

removed lines

parent facb2f89
...@@ -6,8 +6,6 @@ OutputType = Literal[ ...@@ -6,8 +6,6 @@ OutputType = Literal[
"loglikelihood", "loglikelihood_rolling", "generate_until", "multiple_choice" "loglikelihood", "loglikelihood_rolling", "generate_until", "multiple_choice"
] ]
InputType = Literal["text", "text_image"]
@dataclass @dataclass
class Instance: class Instance:
...@@ -16,9 +14,6 @@ class Instance: ...@@ -16,9 +14,6 @@ class Instance:
arguments: tuple arguments: tuple
idx: int idx: int
# Input type for multimodal
input_type: InputType = "text"
metadata: Tuple[Optional[str], Optional[int], Optional[int]] = field( metadata: Tuple[Optional[str], Optional[int], Optional[int]] = field(
default_factory=lambda: (None, None, None) default_factory=lambda: (None, None, None)
) )
......
...@@ -36,7 +36,7 @@ class LM(abc.ABC): ...@@ -36,7 +36,7 @@ class LM(abc.ABC):
LM calls whenever possible. LM calls whenever possible.
:param requests: list[Instance] :param requests: list[Instance]
A list of Instance objects, with property `args` which returns a tuple (context, continuation, visual_list). A list of Instance objects, with property `args` which returns a tuple (context, continuation).
`context: str` `context: str`
Context string. Implementations of LM must be able to handle an Context string. Implementations of LM must be able to handle an
empty context string. empty context string.
...@@ -44,8 +44,6 @@ class LM(abc.ABC): ...@@ -44,8 +44,6 @@ class LM(abc.ABC):
The continuation over which log likelihood will be calculated. If The continuation over which log likelihood will be calculated. If
there is a word boundary, the space should be in the continuation. there is a word boundary, the space should be in the continuation.
For example, context="hello" continuation=" world" is correct. For example, context="hello" continuation=" world" is correct.
'visual_list: Optional[list[dict]]'
Visual Input to the model. Can be None
:return: list[tuple[float, bool]] :return: list[tuple[float, bool]]
A list of pairs (logprob, isgreedy) A list of pairs (logprob, isgreedy)
......
...@@ -325,9 +325,7 @@ class Llava(LM): ...@@ -325,9 +325,7 @@ class Llava(LM):
pbar = tqdm(total=num_iters, disable=(self.rank != 0), desc="Model Responding") pbar = tqdm(total=num_iters, disable=(self.rank != 0), desc="Model Responding")
for chunk in chunks: for chunk in chunks:
contexts, all_gen_kwargs, visuals = zip(*chunk) contexts, all_gen_kwargs, visuals = zip(*chunk)
# task = task[0]
# visuals = [doc_to_visual[0](doc[0])]
visuals = self.flatten(visuals) visuals = self.flatten(visuals)
# we assume all gen kwargs in the batch are the same # we assume all gen kwargs in the batch are the same
# this is safe to assume because the `grouper` object ensures it. # this is safe to assume because the `grouper` object ensures it.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment