|
1 | 1 | from unitxt import evaluate, load_dataset |
2 | 2 | from unitxt.inference import CrossProviderInferenceEngine |
3 | 3 |
|
4 | | -data = load_dataset( |
5 | | - "benchmarks.glue[max_samples_per_subset=5, format=formats.chat_api, system_prompt=system_prompts.general.be_concise]", |
| 4 | +dataset = load_dataset( |
| 5 | + "benchmarks.glue", |
| 6 | + format="formats.chat_api", |
| 7 | + system_prompt="system_prompts.general.be_concise", |
| 8 | + max_samples_per_subset=5, |
6 | 9 | split="test", |
7 | 10 | use_cache=True, |
8 | 11 | ) |
9 | 12 |
|
10 | 13 | model = CrossProviderInferenceEngine( |
11 | | - model="llama-3-8b-instruct", temperature=0.0, top_p=1.0, provider="watsonx" |
| 14 | + model="llama-3-2-3b-instruct", temperature=0.0, top_p=1.0, provider="watsonx" |
12 | 15 | ) |
13 | 16 | """ |
14 | 17 | We are using a CrossProviderInferenceEngine inference engine that supply api access to provider such as: |
|
18 | 21 | about the the open ai api arguments the CrossProviderInferenceEngine follows. |
19 | 22 | """ |
20 | 23 |
|
21 | | -predictions = model(data) |
| 24 | +predictions = model(dataset) |
22 | 25 |
|
23 | | -results = evaluate(predictions=predictions, data=data) |
| 26 | +results = evaluate(predictions=predictions, data=dataset) |
24 | 27 |
|
25 | 28 | print("Global Results:") |
26 | 29 | print(results.global_scores.summary) |
27 | 30 |
|
28 | | -print("Instance Results:") |
29 | | -print(results.instance_scores.summary) |
| 31 | +print("Subsets Results:") |
| 32 | +print(results.subsets_scores.summary) |
0 commit comments