Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IBM Research BAM provider #711

Merged
merged 11 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/ibm-granite-vs-llama/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To get started, set your BAM_API_KEY environment variable.

Next, edit promptfooconfig.yaml.

Then run:

```
promptfoo eval
```

Afterwards, you can view the results by running `promptfoo view`
34 changes: 34 additions & 0 deletions examples/ibm-granite-vs-llama/promptfooconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

description: 'IBM Granite vs Llama'

prompts:
- 'Be consise. Answer this riddle :{{riddle}}'

providers:
- id: bam:chat:meta-llama/llama-2-70b-chat
config:
temperature: 0.01 # minimum temperature
max_new_tokens: 1024
prompt:
prefix: '[INST] '
suffix: '[/INST] '
- id: bam:chat:ibm/granite-13b-chat-v2
config:
temperature: 0.01 # minimum temperature
max_new_tokens: 1024
prompt:
prefix: '[INST] '
suffix: '[/INST] '

defaultTest:
assert:
- type: latency
threshold: 3000
- type: javascript
value: 'output.length <= 100 ? 1 : output.length > 1000 ? 0 : 1 - (output.length - 100) / 900'

tests:
- vars:
riddle: >-
I am light as a feather, but even the world's strongest man couldn’t
hold me for much longer than a minute. What am I ?
Loading
Loading