Skip to content

Commit

Permalink
allow model spec
Browse files Browse the repository at this point in the history
  • Loading branch information
agt committed Feb 18, 2024
1 parent 6085628 commit b49b806
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 39 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/docker.chatgpt-minimal.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build notebook
on:
push:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout notebook
uses: actions/checkout@v3

- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate tags and labels
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Check Free Space 0
run: |
echo "Free space:"
df -h
- name: Docker/ENV cleanup Cleanup
run: |
docker image prune -a -f
docker container prune -f
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check Free Space 1
run: |
echo "Free space:"
df -h
- name: Build and push notebook
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion src/pages/api/chat-completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const handler = async (req: Request): Promise<Response> => {
}
apiUrl = `${apiBaseUrl}/v1/chat/completions`
apiKey = process.env.OPENAI_API_KEY || ''
model = 'gpt-3.5-turbo' // todo: allow this to be passed through from client and support gpt-4
model = process.env.OPENAI_API_MODEL || 'gpt-3.5-turbo' // todo: allow this to be passed through from client and support gpt-4
}
const stream = await OpenAIStream(apiUrl, apiKey, model, messagesToSend)

Expand Down

0 comments on commit b49b806

Please sign in to comment.