Spaces:
Sleeping
Sleeping
Merge pull request #3 from gvatsal60/feature/hugging_face_add_VG
Browse files- .devcontainer/devcontainer.json +1 -2
- .github/workflows/huggingface.yaml +23 -0
- Dockerfile +20 -5
- README.md +15 -0
- docker-compose.yaml +0 -4
.devcontainer/devcontainer.json
CHANGED
|
@@ -16,7 +16,6 @@
|
|
| 16 |
"DavidAnson.vscode-markdownlint",
|
| 17 |
"GitHub.copilot",
|
| 18 |
"GitHub.copilot-chat",
|
| 19 |
-
"SonarSource.sonarlint-vscode",
|
| 20 |
"Tyriar.sort-lines",
|
| 21 |
"bradzacher.vscode-copy-filename",
|
| 22 |
"charliermarsh.ruff",
|
|
@@ -63,7 +62,7 @@
|
|
| 63 |
}
|
| 64 |
}
|
| 65 |
},
|
| 66 |
-
"image": "mcr.microsoft.com/devcontainers/python:3.12",
|
| 67 |
"postCreateCommand": "chmod +x ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh && ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh",
|
| 68 |
"runArgs": [
|
| 69 |
"--rm",
|
|
|
|
| 16 |
"DavidAnson.vscode-markdownlint",
|
| 17 |
"GitHub.copilot",
|
| 18 |
"GitHub.copilot-chat",
|
|
|
|
| 19 |
"Tyriar.sort-lines",
|
| 20 |
"bradzacher.vscode-copy-filename",
|
| 21 |
"charliermarsh.ruff",
|
|
|
|
| 62 |
}
|
| 63 |
}
|
| 64 |
},
|
| 65 |
+
"image": "mcr.microsoft.com/devcontainers/python:3.12:latest",
|
| 66 |
"postCreateCommand": "chmod +x ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh && ${containerWorkspaceFolder}/.devcontainer/postCreateScript.sh",
|
| 67 |
"runArgs": [
|
| 68 |
"--rm",
|
.github/workflows/huggingface.yaml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face hub
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches: ["master"]
|
| 5 |
+
permissions:
|
| 6 |
+
contents: write
|
| 7 |
+
pull-requests: write
|
| 8 |
+
jobs:
|
| 9 |
+
sync-to-hub:
|
| 10 |
+
runs-on: ubuntu-latest
|
| 11 |
+
steps:
|
| 12 |
+
- uses: actions/checkout@v5
|
| 13 |
+
with:
|
| 14 |
+
fetch-depth: 0
|
| 15 |
+
lfs: true
|
| 16 |
+
- name: Push to hub
|
| 17 |
+
env:
|
| 18 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 19 |
+
HF_USERNAME: ${{ github.repository_owner }}
|
| 20 |
+
HF_SPACE: ${{ github.repository }}
|
| 21 |
+
HF_BRANCH: main
|
| 22 |
+
run: |
|
| 23 |
+
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_SPACE master:$HF_BRANCH
|
Dockerfile
CHANGED
|
@@ -15,7 +15,8 @@
|
|
| 15 |
# ##########################################################################
|
| 16 |
# Base Image
|
| 17 |
# ##########################################################################
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
# ##########################################################################
|
| 21 |
# Maintainer
|
|
@@ -30,10 +31,24 @@ WORKDIR /app
|
|
| 30 |
# ##########################################################################
|
| 31 |
# Copy Files
|
| 32 |
# ##########################################################################
|
| 33 |
-
|
| 34 |
-
COPY
|
|
|
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
# ##########################################################################
|
| 39 |
# Expose Port
|
|
@@ -43,4 +58,4 @@ EXPOSE 8501
|
|
| 43 |
# ##########################################################################
|
| 44 |
# Command to Run
|
| 45 |
# ##########################################################################
|
| 46 |
-
|
|
|
|
| 15 |
# ##########################################################################
|
| 16 |
# Base Image
|
| 17 |
# ##########################################################################
|
| 18 |
+
# Stage 1: Builder - Install dependencies
|
| 19 |
+
FROM python:3.12-slim AS builder
|
| 20 |
|
| 21 |
# ##########################################################################
|
| 22 |
# Maintainer
|
|
|
|
| 31 |
# ##########################################################################
|
| 32 |
# Copy Files
|
| 33 |
# ##########################################################################
|
| 34 |
+
# Copy requirements and install them
|
| 35 |
+
COPY requirements.txt .
|
| 36 |
+
RUN pip install --user --no-cache-dir -r requirements.txt
|
| 37 |
|
| 38 |
+
# Copy application code
|
| 39 |
+
COPY src/ .
|
| 40 |
+
|
| 41 |
+
# Stage 2: Runtime - Create the distroless image
|
| 42 |
+
FROM gcr.io/distroless/python3.12:nonroot
|
| 43 |
+
|
| 44 |
+
WORKDIR /app
|
| 45 |
+
|
| 46 |
+
# Copy installed packages and application code from the builder stage
|
| 47 |
+
COPY --from=builder /root/.local /usr/.local
|
| 48 |
+
COPY --from=builder /app .
|
| 49 |
+
|
| 50 |
+
# Add the user's local bin directory to the PATH
|
| 51 |
+
ENV PATH=/usr/.local/bin:$PATH
|
| 52 |
|
| 53 |
# ##########################################################################
|
| 54 |
# Expose Port
|
|
|
|
| 58 |
# ##########################################################################
|
| 59 |
# Command to Run
|
| 60 |
# ##########################################################################
|
| 61 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|
README.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Gemini Chatbot
|
| 2 |
|
| 3 |
Gemini Chatbot is an AI-powered conversational assistant designed to help users interact with various models through natural language. Built with Python, it leverages modern AI models to provide intelligent, context-aware responses.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Gemini Chatbot
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 8501
|
| 8 |
+
tags:
|
| 9 |
+
- streamlit
|
| 10 |
+
pinned: false
|
| 11 |
+
short_description: A conversational chatbot powered by Google's Gemini models
|
| 12 |
+
license: apache-2.0
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<!-- markdownlint-disable MD025 -->
|
| 16 |
# Gemini Chatbot
|
| 17 |
|
| 18 |
Gemini Chatbot is an AI-powered conversational assistant designed to help users interact with various models through natural language. Built with Python, it leverages modern AI models to provide intelligent, context-aware responses.
|
docker-compose.yaml
CHANGED
|
@@ -5,8 +5,4 @@ services:
|
|
| 5 |
dockerfile: Dockerfile
|
| 6 |
ports:
|
| 7 |
- "8501:8501"
|
| 8 |
-
volumes:
|
| 9 |
-
- .:/app
|
| 10 |
-
environment:
|
| 11 |
-
- PYTHONUNBUFFERED=1
|
| 12 |
restart: unless-stopped
|
|
|
|
| 5 |
dockerfile: Dockerfile
|
| 6 |
ports:
|
| 7 |
- "8501:8501"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
restart: unless-stopped
|