-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ignore vLLM test (#57) * add: vllm support * fix: change model in test * formatted with black * add: ignore tests for vllm on github * ignore pytest for vllm * docs(contributor): contrib-readme-action has updated readme * pip3->pip; nit * Add multimodal tasks * docs(contributor): contrib-readme-action has updated readme * Update mathvista.py Added prompts for answer extraction. * Update mathvista.py Added the error handling when importing packages. * raise exception if cannot parse answer, do not return an arbitrary answer * remove unused comments * feat: Added Ollama engine via OpenAI api (#51) * feat: Added Ollama engine via OpenAI api * fix: Added PR remarks and test --------- Co-authored-by: Nihal Nayak <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mert Yuksekgonul <[email protected]> Co-authored-by: Pan Lu <[email protected]> Co-authored-by: Atakan Tekparmak <[email protected]>
- Loading branch information
1 parent
2980131
commit cd0394e
Showing
8 changed files
with
657 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from textgrad.engine import get_engine | ||
|
||
def test_ollama_engine(): | ||
# Declare test constants | ||
OLLAMA_BASE_URL = 'http://localhost:11434/v1' | ||
MODEL_STRING = "test-model-string" | ||
|
||
# Initialise the engine | ||
engine = get_engine("ollama-" + MODEL_STRING) | ||
|
||
assert engine | ||
assert engine.model_string == MODEL_STRING | ||
assert engine.base_url == OLLAMA_BASE_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from textgrad.engine import EngineLM | ||
|
||
|
||
def load_multimodal_instance_task(task_name: str, evaluation_api: EngineLM, *args, **kwargs): | ||
if task_name == "mathvista": | ||
from textgrad.tasks.multimodal.mathvista import MathVistaDataset | ||
test_set = MathVistaDataset(evaluation_api=evaluation_api, split="testmini", *args, **kwargs) | ||
return test_set | ||
|
||
elif task_name == "scienceqa": | ||
from textgrad.tasks.multimodal.scienceqa import ScienceQADataset | ||
test_set = ScienceQADataset(evaluation_api=evaluation_api, split="test", *args, **kwargs) | ||
return test_set | ||
|
||
else: | ||
raise ValueError(f"Instance task {task_name} not found.") |
Oops, something went wrong.