mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-05-15 11:57:12 +02:00
Used smaller-sized images for the test cases
This commit is contained in:
parent
252ea50717
commit
0248f21654
@ -341,7 +341,7 @@ public class OllamaAPIIntegrationTest {
|
|||||||
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(IMAGE_MODEL_LLAVA);
|
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(IMAGE_MODEL_LLAVA);
|
||||||
OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER,
|
OllamaChatRequest requestModel = builder.withMessage(OllamaChatMessageRole.USER,
|
||||||
"What's in the picture?",
|
"What's in the picture?",
|
||||||
Collections.emptyList(), List.of(getImageFileFromClasspath("dog-on-a-boat.jpg")))
|
Collections.emptyList(), List.of(getImageFileFromClasspath("emoji-smile.jpeg")))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
OllamaChatResult chatResult = api.chat(requestModel);
|
OllamaChatResult chatResult = api.chat(requestModel);
|
||||||
@ -609,12 +609,12 @@ public class OllamaAPIIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Order(17)
|
@Order(17)
|
||||||
void testAskModelWithOptionsAndImageURLs()
|
void testAskModelWithOptionsAndImageURLs()
|
||||||
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
||||||
api.pullModel(IMAGE_MODEL_LLAVA);
|
api.pullModel(IMAGE_MODEL_LLAVA);
|
||||||
|
|
||||||
OllamaResult result = api.generateWithImageURLs(IMAGE_MODEL_LLAVA, "What is in this image?",
|
OllamaResult result = api.generateWithImageURLs(IMAGE_MODEL_LLAVA, "What is in this image?",
|
||||||
List.of("https://t3.ftcdn.net/jpg/02/96/63/80/360_F_296638053_0gUVA4WVBKceGsIr7LNqRWSnkusi07dq.jpg"),
|
List.of("https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Noto_Emoji_v2.034_1f642.svg/360px-Noto_Emoji_v2.034_1f642.svg.png"),
|
||||||
new OptionsBuilder().build());
|
new OptionsBuilder().build());
|
||||||
assertNotNull(result);
|
assertNotNull(result);
|
||||||
assertNotNull(result.getResponse());
|
assertNotNull(result.getResponse());
|
||||||
@ -626,7 +626,7 @@ public class OllamaAPIIntegrationTest {
|
|||||||
void testAskModelWithOptionsAndImageFiles()
|
void testAskModelWithOptionsAndImageFiles()
|
||||||
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
||||||
api.pullModel(IMAGE_MODEL_LLAVA);
|
api.pullModel(IMAGE_MODEL_LLAVA);
|
||||||
File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg");
|
File imageFile = getImageFileFromClasspath("emoji-smile.jpeg");
|
||||||
try {
|
try {
|
||||||
OllamaResult result = api.generateWithImageFiles(IMAGE_MODEL_LLAVA, "What is in this image?",
|
OllamaResult result = api.generateWithImageFiles(IMAGE_MODEL_LLAVA, "What is in this image?",
|
||||||
List.of(imageFile),
|
List.of(imageFile),
|
||||||
@ -645,7 +645,7 @@ public class OllamaAPIIntegrationTest {
|
|||||||
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
throws OllamaBaseException, IOException, URISyntaxException, InterruptedException {
|
||||||
api.pullModel(IMAGE_MODEL_LLAVA);
|
api.pullModel(IMAGE_MODEL_LLAVA);
|
||||||
|
|
||||||
File imageFile = getImageFileFromClasspath("dog-on-a-boat.jpg");
|
File imageFile = getImageFileFromClasspath("emoji-smile.jpeg");
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
|
BIN
src/test/resources/emoji-smile.jpeg
Normal file
BIN
src/test/resources/emoji-smile.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
Loading…
x
Reference in New Issue
Block a user