Skip to content

makes index an integer in POST /activation/single#107

Draft
anthonyduong9 wants to merge 1 commit intomainfrom
make-index-an-integer-in-POST-activation-single
Draft

makes index an integer in POST /activation/single#107
anthonyduong9 wants to merge 1 commit intomainfrom
make-index-an-integer-in-POST-activation-single

Conversation

@anthonyduong9
Copy link
Contributor

@anthonyduong9 anthonyduong9 commented May 27, 2025

Problem

For all endpoints, the value for "index" in the request body has to be an integer, except for POST /activations/single.

Fix

  • Replacing string with integer in single.yaml.
  • From schemas, running make setup-all-inference VERSION=2.0.0.
  • Casting value to Number in inference.ts.
  • Updating apps/webapp/package.json.

Testing

From apps/inference, I ran

poetry run python start.py \
  --model_id gemma-2-2b \
  --sae_sets gemmascope-res-16k \
  --model_dtype bfloat16 \
  --sae_dtype bfloat16

and then

curl -X POST http://127.0.0.1:5002/v1/activation/single \
-H "Content-Type: application/json" \
-d '{
 "prompt": "this is about dogs!",
 "model": "gemma-2-2b",
 "source": "20-gemmascope-res-16k",
 "index": 12082
}'

.

Fixes #106

@codecov
Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 39.02%. Comparing base (fc421db) to head (32d277c).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
...uronpedia_inference/endpoints/activation/single.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            main     #107       +/-   ##
==========================================
+ Coverage   8.17%   39.02%   +30.85%     
==========================================
  Files        119       20       -99     
  Lines      16630     1394    -15236     
  Branches     360      198      -162     
==========================================
- Hits        1359      544      -815     
+ Misses     15260      839    -14421     
  Partials      11       11               
Flag Coverage Δ
autointerp 100.00% <ø> (ø)
inference 37.77% <0.00%> (ø)
webapp ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anthonyduong9 anthonyduong9 force-pushed the make-index-an-integer-in-POST-activation-single branch from c4d73fe to 32d277c Compare May 27, 2025 08:19
@anthonyduong9
Copy link
Contributor Author

@hijohnnylin if this looks like the right approach, I think we need you to publish the 2.0.0 version of neuronpedia-inference-client to NPM, so I can update apps/webapp/package-lock.json. Then we can test that webapp works with the changes, and merge them.

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.

[inference] some endpoints take index as string, others take it as int

1 participant