Skip to content

Commit

Permalink
rename notebook and fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed Feb 28, 2024
1 parent 8df3e6b commit 4aa17e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/lmm_example.ipynb → examples/va_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"prompt = \"Here is the image of a page from a document. Parse this document, if you can find a table and its columns in the page, print Table Title in json format and if not found Table title will be 'N/A'\"\n",
"# The llava model can take two additional parameters\n",
"# temperature (float): The temperature parameter for text generation. Higher values (e.g., 1.0) make the output more random, while lower values (e.g., 0.1) make it more deterministic. Default is 0.2.\n",
"# max_new_tokens (int): The maximum number of tokens to generate. Default is 256.\n",
"# max_new_tokens (int): The maximum number of tokens to generate. Default is 1500.\n",
"resp = model.generate(prompt, image_path, temperature=0.1, max_new_tokens=1500)\n",
"print(textwrap.fill(resp, 80))"
]
Expand Down
8 changes: 4 additions & 4 deletions vision_agent/lmm/lmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def generate(
self,
prompt: str,
image: Optional[Union[str, Path]] = None,
temperature: float = 0.2,
max_new_tokens: int = 256,
temperature: float = 0.1,
max_new_tokens: int = 1500,
) -> str:
data = {"prompt": prompt}
if image:
data["image"] = encode_image(image)
data["temperature"] = temperature
data["max_new_tokens"] = max_new_tokens
data["temperature"] = temperature # type: ignore
data["max_new_tokens"] = max_new_tokens # type: ignore
res = requests.post(
_LLAVA_ENDPOINT,
headers={"Content-Type": "application/json"},
Expand Down

0 comments on commit 4aa17e7

Please sign in to comment.