Skip to content

Commit e256b43

Browse files
committed
Generated Streamlit files
1 parent 8290036 commit e256b43

6 files changed

Lines changed: 32 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ pip install autoemx
9090
python -m autoemx.web
9191
```
9292

93+
A public hosted demo that **runs fits** can be deployed for free on
94+
[Streamlit Community Cloud](https://share.streamlit.io) from this GitHub
95+
repo (main file: `autoemx/web/app.py`). See `docs/user/web_gui.rst`.
96+
9397

9498
---
9599

autoemx/web/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939

4040

4141
def _is_hosted_demo() -> bool:
42-
return bool(os.environ.get("SPACE_ID") or os.environ.get("AUTOEMX_DEMO"))
42+
if os.environ.get("AUTOEMX_DEMO"):
43+
return True
44+
# Streamlit Community Cloud mounts the repo here.
45+
return os.path.isdir("/mount/src")
4346

4447

4548
def _write_upload(upload, dest_dir: Path) -> Path:

docs/user/web_gui.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,20 @@ If the EMSA/MSA reader fails, the GUI shows **Download reader report** and
5454
header, and the first data lines — enough to extend ``load_msa``. Attach the
5555
original spectrum to the email if you can share it.
5656

57-
Hugging Face demo (optional)
58-
----------------------------
59-
60-
The GUI can be published later as a Hugging Face Space pointing at this
61-
repository (``autoemx/web/app.py``). Set ``AUTOEMX_DEMO=1`` or rely on the
62-
Space-provided ``SPACE_ID`` environment variable to show the demo banner
63-
and cap uploads at two files. A Hugging Face account is not required to
64-
run the GUI locally. Never commit Hugging Face tokens to the repository.
57+
Public demo that can run fits (free)
58+
-----------------------------------
59+
60+
Use Streamlit Community Cloud.
61+
62+
1. Push this repo to GitHub (including ``autoemx/web/app.py``,
63+
``requirements.txt``, ``packages.txt``, and ``runtime.txt``).
64+
2. Sign in at https://share.streamlit.io with GitHub.
65+
3. **Create app** → this repository → branch ``main`` → main file
66+
``autoemx/web/app.py``.
67+
4. Deploy. The ``*.streamlit.app`` URL is the public demo.
68+
69+
The app treats Community Cloud as a demo (banner, two-file cap, license).
70+
Fits still take 0.5–3 minutes. The first request may also build detector
71+
convolution matrices. Community Cloud has limited RAM; if the app is killed,
72+
reboot it from the Streamlit dashboard. Local ``python -m autoemx.web``
73+
remains the production GUI.

packages.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
libgl1
2+
libglib2.0-0
3+
build-essential

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Streamlit Community Cloud (and similar hosts) install from this file.
2+
# Local users should still use: pip install autoemx
3+
-e .

runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.11

0 commit comments

Comments
 (0)