-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add inference engines to the catalog (#1394)
Signed-off-by: Martín Santillán Cooper <[email protected]>
- Loading branch information
1 parent
d116a0b
commit 746394e
Showing
9 changed files
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from unitxt.catalog import add_to_catalog | ||
from unitxt.inference import CrossProviderInferenceEngine | ||
|
||
model_list = ["meta-llama/llama-3-8b-instruct", "meta-llama/llama-3-70b-instruct"] | ||
|
||
for model in model_list: | ||
model_label = model.split("/")[1].replace("-", "_").replace(".", ",").lower() | ||
inference_model = CrossProviderInferenceEngine( | ||
model=model, provider="watsonx", max_tokens=2048, seed=42 | ||
) | ||
add_to_catalog( | ||
inference_model, f"engines.cross_provider.{model_label}", overwrite=True | ||
) |
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,7 @@ | ||
from unitxt.catalog import add_to_catalog | ||
from unitxt.inference import OpenAiInferenceEngine | ||
|
||
model_name = "gpt-4o" | ||
model_label = model_name.replace("-", "_").lower() | ||
inference_model = OpenAiInferenceEngine(model_name=model_name, max_tokens=2048, seed=42) | ||
add_to_catalog(inference_model, f"engines.openai.{model_label}", overwrite=True) |
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,13 @@ | ||
from unitxt.catalog import add_to_catalog | ||
from unitxt.inference import RITSInferenceEngine | ||
|
||
model_list = [ | ||
"meta-llama/Llama-3.1-8B-Instruct", | ||
"meta-llama/llama-3-1-70b-instruct", | ||
"meta-llama/llama-3-1-405b-instruct-fp8", | ||
] | ||
|
||
for model in model_list: | ||
model_label = model.split("/")[1].replace("-", "_").replace(",", "_").lower() | ||
inference_model = RITSInferenceEngine(model_name=model, max_tokens=2048, seed=42) | ||
add_to_catalog(inference_model, f"engines.rits.{model_label}", overwrite=True) |
7 changes: 7 additions & 0 deletions
7
src/unitxt/catalog/engines/cross_provider/llama_3_70b_instruct.json
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,7 @@ | ||
{ | ||
"__type__": "cross_provider_inference_engine", | ||
"model": "meta-llama/llama-3-70b-instruct", | ||
"provider": "watsonx", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |
7 changes: 7 additions & 0 deletions
7
src/unitxt/catalog/engines/cross_provider/llama_3_8b_instruct.json
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,7 @@ | ||
{ | ||
"__type__": "cross_provider_inference_engine", | ||
"model": "meta-llama/llama-3-8b-instruct", | ||
"provider": "watsonx", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |
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,6 @@ | ||
{ | ||
"__type__": "open_ai_inference_engine", | ||
"model_name": "gpt-4o", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |
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,6 @@ | ||
{ | ||
"__type__": "rits_inference_engine", | ||
"model_name": "meta-llama/Llama-3.1-8B-Instruct", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |
6 changes: 6 additions & 0 deletions
6
src/unitxt/catalog/engines/rits/llama_3_1_405b_instruct_fp8.json
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,6 @@ | ||
{ | ||
"__type__": "rits_inference_engine", | ||
"model_name": "meta-llama/llama-3-1-405b-instruct-fp8", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |
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,6 @@ | ||
{ | ||
"__type__": "rits_inference_engine", | ||
"model_name": "meta-llama/llama-3-1-70b-instruct", | ||
"max_tokens": 2048, | ||
"seed": 42 | ||
} |