Duan Shuo commited on
Commit ·
9e28a6b
0
Parent(s):
Initial commit - correct project files
Browse files- .github/workflows/deploy.yml +18 -0
- Dockerfile +14 -0
- README.md +9 -0
- app.py +10 -0
- requirements.txt +1 -0
.github/workflows/deploy.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face hub
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches: [main]
|
| 5 |
+
# to run this workflow manually from the Actions tab
|
| 6 |
+
workflow_dispatch:
|
| 7 |
+
jobs:
|
| 8 |
+
sync-to-hub:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
steps:
|
| 11 |
+
- uses: actions/checkout@v3
|
| 12 |
+
with:
|
| 13 |
+
fetch-depth: 0
|
| 14 |
+
lfs: true
|
| 15 |
+
- name: Push to hub
|
| 16 |
+
env:
|
| 17 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 18 |
+
run: git push -–force https://xldzha:$HF_TOKEN@huggingface.co/spaces/xldzha/FinTech-Self-Learning-Project main
|
Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
WORKDIR /usr/src/app
|
| 3 |
+
# Get requirements
|
| 4 |
+
COPY requirements.txt .
|
| 5 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 6 |
+
# Copy code
|
| 7 |
+
COPY . .
|
| 8 |
+
# Expose Gradio's default port
|
| 9 |
+
EXPOSE 7860
|
| 10 |
+
# Set environment variables for Docker deployment
|
| 11 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 12 |
+
ENV GRADIO_SERVER_PORT="7860"
|
| 13 |
+
# Run the application
|
| 14 |
+
CMD ["python", "app.py"]
|
README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: gradio-test-proj
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: gradio
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
app.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def greet(name):
|
| 4 |
+
return f"Hello {name}, I'm Duan Shuo"
|
| 5 |
+
|
| 6 |
+
demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
|
| 7 |
+
|
| 8 |
+
if __name__ == "__main__":
|
| 9 |
+
demo.launch()
|
| 10 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
gradio
|