diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3cdc556 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +__pycache__ +*.pyc +*.pyo +*.pyd +.Python +env/ +venv/ +.env +.venv +env.bak/ +venv.bak/ +.git +.gitignore +.github diff --git a/.github/workflows/huggingface.yml b/.github/workflows/huggingface.yml new file mode 100644 index 0000000..b2948fc --- /dev/null +++ b/.github/workflows/huggingface.yml @@ -0,0 +1,21 @@ +name: Sync to Hugging Face hub +on: + push: + branches: [main] + + # to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + sync-to-hub: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - name: Push to hub + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} + run: | + git push --force https://oauth2:$HF_TOKEN@huggingface.co/spaces/twinkle-ai/tw-eval-analyzer main diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d927629 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.13.5-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +COPY requirements.txt ./ +COPY . . + +RUN pip3 install -r requirements.txt + +# Hugging Face Spaces requires port 7860 +EXPOSE 7860 + +HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health + +ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] diff --git a/README.md b/README.md index c4d84eb..080f3c8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +--- +title: Twinkle Eval Analyzer +emoji: ✨ +colorFrom: blue +colorTo: indigo +sdk: docker +app_file: app.py +pinned: false +--- + # 🌟 Eval Analyzer 一個基於 🎈 **Streamlit** 的互動式工具,用來分析 **[Twinkle Eval](https://github.com/ai-twinkle/Eval)** 格式的評估檔案(`.json` / `.jsonl`)。