-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7490017
Showing
51 changed files
with
4,652 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.venv/ | ||
movie-detectives-server_latest.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 影片数据源 | ||
TMDB_API_KEY=XXX | ||
|
||
# gemini 服务配置 | ||
GCP_PROJECT_ID=XXX | ||
GCP_LOCATION=us-XXX | ||
GCP_SERVICE_ACCOUNT_FILE=XXX.json | ||
|
||
# Groq 服务配置 | ||
GROQ_API_KEY=XXX | ||
GROQ_MODEL_NAME=llama3-70b-8192 | ||
|
||
|
||
# Ollama 服务配置 | ||
# OLLAMA_BASE_URL=http://127.0.0.1:11434 # 本地连接 | ||
# OLLAMA_BASE_URL=http://XXX:11434 # 外网连接 | ||
# OLLAMA_BASE_URL=XXXXXXXXX # 内网连接 | ||
|
||
# qwen 服务配置 | ||
QWEN_MODEL_NAME=qwen-long | ||
QWEN_API_KEY=XXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test and lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry install | ||
- name: Run tests | ||
run: poetry run python -m unittest -v | ||
|
||
- name: Lint | ||
uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
__pycache__/ | ||
.venv/ | ||
movie-detectives-server_latest.tar.gz | ||
.env | ||
googlecloud_gemini.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.5 | ||
hooks: | ||
- id: ruff | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"CodeGPT.apiKey": "Ollama" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=linux/amd64 python:3.12-slim | ||
|
||
# macos arm64 | ||
# FROM --platform=linux/arm64 python:3.12-slim | ||
|
||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /workdir | ||
COPY ./pyproject.toml /workdir/pyproject.toml | ||
RUN pip3 install poetry==1.8.2 | ||
RUN poetry config virtualenvs.create false | ||
RUN poetry install --no-dev && rm -rf $POETRY_CACHE_DIR | ||
|
||
COPY . /workdir | ||
EXPOSE 9091 | ||
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "9091"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
all: | ||
@echo "see README.md" | ||
|
||
.venv: | ||
poetry install | ||
|
||
.PHONY: run | ||
run: | ||
uvicorn api.main:app --reload | ||
|
||
.PHONY: test | ||
test: | ||
python -m unittest -v | ||
|
||
.PHONY: ruff | ||
ruff: | ||
ruff check --fix | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf movie-detectives-server_latest.tar.gz | ||
|
||
.PHONY: build | ||
build: clean | ||
docker image rm movie-detectives-server | ||
docker build -t movie-detectives-server . | ||
docker save movie-detectives-server:latest | gzip > movie-detectives-server_latest.tar.gz |
Oops, something went wrong.