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

add GenAI_HFLM class to support microservice. #16

Merged

Conversation

lkk12014402
Copy link
Collaborator

Description

customize a GenAI_HFLM class to request GenAI microservice.

@lkk12014402
Copy link
Collaborator Author

lkk12014402 commented May 22, 2024

usage

cd GenAIEval/evaluation/lm_evaluation_harness/examples

python main.py \
    --model genai-hf \
    --model_args "base_url=http://localhost:9000,tokenizer=Intel/neural-chat-7b-v3-3" \
    --tasks  "lambada_openai" \
    --batch_size 2

corresponds to this pr to start a llm server

@lkk12014402
Copy link
Collaborator Author

lkk12014402 commented May 22, 2024

accuracy comparison

use GenAIComps service

start a server with opea-project/GenAIComps#82

python main.py \
    --model genai-hf \
    --model_args "base_url=http://localhost:9000,tokenizer=Intel/neural-chat-7b-v3-3" \
    --tasks  "lambada_openai" \
    --batch_size 2 \
    --limit 100

|    Tasks     |Version|Filter|n-shot|  Metric  |Value |   |Stderr|
|--------------|------:|------|-----:|----------|-----:|---|-----:|
|lambada_openai|      1|none  |     0|perplexity|3.0229|±  |0.4102|
|              |       |none  |     0|acc       |0.7400|±  |0.0441|

original lm-eval

python main.py \
    --model hf \
    --model_args pretrained=Intel/neural-chat-7b-v3-3 \
    --tasks  "lambada_openai" \
    --device cpu \
    --batch_size 2 \
    --limit 100

|    Tasks     |Version|Filter|n-shot|  Metric  |Value |   |Stderr|
|--------------|------:|------|-----:|----------|-----:|---|-----:|
|lambada_openai|      1|none  |     0|perplexity|3.0229|±  |0.4102|
|              |       |none  |     0|acc       |0.7400|±  |0.0441|

note: You can expect results to vary slightly for different input_ids, which has an expect on the inference like position embedding:

  • GenAIComps accepts full input_ids
  • original lm-eval use input_ids[:-1]

@VincyZhang VincyZhang merged commit ad79fb5 into opea-project:main May 23, 2024
9 checks passed
lkk12014402 pushed a commit that referenced this pull request Sep 19, 2024
* add copyright for doc summary

Signed-off-by: LetongHan <[email protected]>

* Fix copyright for shell and docker files

Signed-off-by: lvliang-intel <[email protected]>

* update shell

Signed-off-by: lvliang-intel <[email protected]>

---------

Signed-off-by: LetongHan <[email protected]>
Signed-off-by: lvliang-intel <[email protected]>
Co-authored-by: lvliang-intel <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants