mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-10-12 10:57:15 +02:00
use previous WSGI implementation
This commit is contained in:
1 parent
95074f23b4
commit
2358d23b69
1 file changed
+17
-16
@@ -1,10 +1,6 @@
|
|||||||
name: 'LLM Prompt Testing'
|
name: 'LLM Prompt Testing (WSGI)'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# push:
|
|
||||||
# branches: [ "main" ]
|
|
||||||
# pull_request:
|
|
||||||
# branches: [ "main" ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -22,11 +18,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: 'set up Python dependencies'
|
||||||
|
run: |
|
||||||
|
pip install -r ${{ github.workspace }}/requirements.txt
|
||||||
|
|
||||||
- name: 'set up Microsoft Phi-3 Mini 4k LLM from HuggingFace'
|
- name: 'set up Microsoft Phi-3 Mini 4k LLM from HuggingFace'
|
||||||
run: |
|
run: |
|
||||||
pip install huggingface-hub[cli]
|
pip install huggingface-hub[cli]
|
||||||
huggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir ${{ github.workspace }}/tests/llm
|
huggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx \
|
||||||
pip install onnxruntime-genai
|
--include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* \
|
||||||
|
--local-dir ${{ github.workspace }}/src/llm
|
||||||
|
|
||||||
- name: 'set up Garak'
|
- name: 'set up Garak'
|
||||||
run: |
|
run: |
|
||||||
@@ -34,20 +35,20 @@ jobs:
|
|||||||
|
|
||||||
- name: 'run HTTP server and call REST API'
|
- name: 'run HTTP server and call REST API'
|
||||||
run: |
|
run: |
|
||||||
nohup python -m tests.api.server > server.log 2>&1 &
|
nohup python -m src.api.server > server.log 2>&1 &
|
||||||
sleep 2
|
sleep 5
|
||||||
curl -X POST -i localhost:9999 -d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' || true
|
curl -X POST -i localhost:9999 -d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' || true
|
||||||
echo
|
echo
|
||||||
|
|
||||||
garak -v \
|
garak -v \
|
||||||
--config ${{ github.workspace }}/tests/tools/garak.config.yml \
|
--config ${{ github.workspace }}/src/tools/garak.config.yml \
|
||||||
--generator_option_file ${{ github.workspace }}/tests/tools/garak.rest.json \
|
--generator_option_file ${{ github.workspace }}/src/tools/garak.rest.json \
|
||||||
--model_type=rest \
|
--model_type=rest \
|
||||||
--parallel_attempts 32
|
--parallel_attempts 16
|
||||||
|
|
||||||
cat server.log
|
cat server.log
|
||||||
|
|
||||||
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
with:
|
# with:
|
||||||
name: 'garak_report'
|
# name: 'garak_report'
|
||||||
path: /home/runner/.local/share/garak/garak_runs/garak.*.html
|
# path: /home/runner/.local/share/garak/garak_runs/garak.*.html
|
||||||
Reference in new issue
Block a user