Spaces:
Runtime error
Runtime error
theresatvan
commited on
Commit
•
567db95
1
Parent(s):
8e5ff05
Add all files from monorepo
Browse files- .devcontainer/Dockerfile +13 -0
- .devcontainer/devcontainer.json +9 -0
- .github/workflows/sync.yml +22 -0
- app.py +4 -0
- requirements.txt +1 -0
.devcontainer/Dockerfile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
COPY . /app/
|
6 |
+
|
7 |
+
RUN pip install -r /app/requirements.txt
|
8 |
+
|
9 |
+
EXPOSE 8501
|
10 |
+
|
11 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
12 |
+
|
13 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
.devcontainer/devcontainer.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"build": {
|
3 |
+
"dockerfile": "Dockerfile",
|
4 |
+
"context": ".."
|
5 |
+
},
|
6 |
+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
|
7 |
+
"workspaceFolder": "/workspace",
|
8 |
+
"postStartCommand": "echo 'Docker container started...'"
|
9 |
+
}
|
.github/workflows/sync.yml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches:
|
5 |
+
- main
|
6 |
+
- 'milestone-**'
|
7 |
+
|
8 |
+
# to run this workflow manually from the Actions tab
|
9 |
+
workflow_dispatch:
|
10 |
+
|
11 |
+
jobs:
|
12 |
+
sync-to-hub:
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
steps:
|
15 |
+
- uses: actions/checkout@v3
|
16 |
+
with:
|
17 |
+
fetch-depth: 0
|
18 |
+
lfs: true
|
19 |
+
- name: Push to hub
|
20 |
+
env:
|
21 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
22 |
+
run: git push https://theresatvan:$HF_TOKEN@huggingface.co/spaces/theresatvan/patent-language-model main
|
app.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
x = st.slider('Select a value')
|
4 |
+
st.write(x, 'squared is', x * x)
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
streamlit
|