Spaces:
Sleeping
Sleeping
Publish app to HF.
Browse files- .dockerignore +2 -0
- .gitignore +2 -0
- Dockerfile +18 -0
- app.py +11 -0
- requirements.txt +1 -0
.dockerignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
venv
|
2 |
+
__pycache__
|
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
venv
|
2 |
+
__pycache__
|
Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
+
|
4 |
+
FROM python:3.9
|
5 |
+
|
6 |
+
WORKDIR /code
|
7 |
+
|
8 |
+
COPY . .
|
9 |
+
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
+
|
12 |
+
|
13 |
+
# Change the port number of our Wave app to 7860
|
14 |
+
# which is default in Hugging Face Spaces.
|
15 |
+
ENV H2O_WAVE_LISTEN=":7860"
|
16 |
+
ENV H2O_WAVE_ADDRESS='http://127.0.0.1:7860'
|
17 |
+
|
18 |
+
CMD ["wave", "run", "app", "--no-reload"]
|
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from h2o_wave import main, app, Q, ui
|
2 |
+
|
3 |
+
|
4 |
+
@app('/')
|
5 |
+
async def serve(q: Q):
|
6 |
+
q.page['hello'] = ui.markdown_card(
|
7 |
+
box='1 1 4 4',
|
8 |
+
title='HF Spaces tutorial',
|
9 |
+
content='Hello World!'
|
10 |
+
)
|
11 |
+
await q.page.save()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
h2o-wave
|