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

use evals to evaluate LLAMA #1

Open
lucemia opened this issue Mar 15, 2023 · 3 comments
Open

use evals to evaluate LLAMA #1

lucemia opened this issue Mar 15, 2023 · 3 comments

Comments

@lucemia
Copy link
Owner

lucemia commented Mar 15, 2023

No description provided.

@lucemia
Copy link
Owner Author

lucemia commented Mar 15, 2023

def eval_sample(self, sample: Any, *_):
prompt = sample["input"]
if self.num_few_shot > 0:
assert is_chat_prompt(sample["input"]), "few shot requires chat prompt"
prompt = sample["input"][:-1]
for s in self.few_shot[: self.num_few_shot]:
prompt += s["sample"]
prompt += sample["input"][-1:]
return evals.check_sampled_text(self.model_spec, prompt, expected=sample["ideal"])

@lucemia
Copy link
Owner Author

lucemia commented Mar 15, 2023

> /Users/chienhsundavidchen/repo/evals-llama/evals/cli/oaieval.py(204)run()
-> result = eval.run(recorder)
(Pdb) eval
<evals.elsuite.basic.match.Match object at 0x13043fbe0>
(Pdb) eval.run
<bound method Match.run of <evals.elsuite.basic.match.Match object at 0x13043fbe0>>
(Pdb) eval_spec
EvalSpec(cls='evals.elsuite.basic.match:Match', args={'samples_jsonl': 'test_match/samples.jsonl'}, key='test-match.s1.simple-v0', group='test-basic')
(Pdb) args.eval
args = Namespace(model='gpt-3.5-turbo', eval='test-match', embedding_model='', ranking_model='', extra_eval_params='', max_samples=None, cache=True, visible=None, seed=20220722, user='', record_path=None, log_to_file=None, debug=False, local_run=True, dry_run=False, dry_run_logging=True)

@lucemia
Copy link
Owner Author

lucemia commented Mar 15, 2023

sample
{'input': [{'role': 'system', 'content': 'Complete the phrase as concisely as possible.'}, {'role': 'user', 'content': 'OpenAI was founded in 20'}], 'ideal': '15'}
(Pdb) self.model_spec
ModelSpec(name='gpt-3.5-turbo', model='gpt-3.5-turbo', is_chat=True, encoding=None, organization=None, api_key=None, extra_options={}, headers={}, strip_completion=True, n_ctx=4096, format=None, key=None, group=None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant