Skip to content

Commit

Permalink
Merge pull request #2044 from PolicyEngine/fix/provide-hf-token
Browse files Browse the repository at this point in the history
Add Hugging Face token to CI/CD, Docker
  • Loading branch information
MaxGhenis authored Dec 4, 2024
2 parents 544b0d4 + f1b2f81 commit a88fca9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ jobs:
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
docker:
name: Docker
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
added:
- Hugging Face connection token to CI/CD scripts and Docker image build script
4 changes: 4 additions & 0 deletions gcp/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
GITHUB_MICRODATA_TOKEN = os.environ["POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN"]
ANTHROPIC_API_KEY = os.environ["ANTHROPIC_API_KEY"]
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
HUGGING_FACE_TOKEN = os.environ["HUGGING_FACE_TOKEN"]

# Export GAE to to .gac.json and DB_PD to .dbpw in the current directory

Expand All @@ -35,6 +36,9 @@
".anthropic_api_key", ANTHROPIC_API_KEY
)
dockerfile = dockerfile.replace(".openai_api_key", OPENAI_API_KEY)
dockerfile = dockerfile.replace(
".hugging_face_token", HUGGING_FACE_TOKEN
)

with open(dockerfile_location, "w") as f:
f.write(dockerfile)
1 change: 1 addition & 0 deletions gcp/policyengine_api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV POLICYENGINE_DB_PASSWORD .dbpw
ENV POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN .github_microdata_token
ENV ANTHROPIC_API_KEY .anthropic_api_key
ENV OPENAI_API_KEY .openai_api_key
ENV HUGGING_FACE_TOKEN .hugging_face_token

WORKDIR /app

Expand Down

0 comments on commit a88fca9

Please sign in to comment.