adamelliotfields
commited on
Update README
Browse files
README.md
CHANGED
@@ -1,72 +1,58 @@
|
|
1 |
---
|
2 |
# https://huggingface.co/docs/hub/en/spaces-config-reference
|
3 |
title: API Inference
|
4 |
-
short_description: Inference on API endpoints
|
5 |
emoji: ⚡
|
6 |
colorFrom: blue
|
7 |
colorTo: green
|
8 |
sdk: streamlit
|
9 |
sdk_version: 1.37.1
|
10 |
python_version: 3.11.9
|
|
|
11 |
app_file: 0_🏠_Home.py
|
12 |
full_width: true
|
13 |
pinned: true
|
14 |
-
header:
|
15 |
license: apache-2.0
|
16 |
models:
|
17 |
-
- stabilityai/stable-diffusion-xl-base-1.0
|
18 |
- black-forest-labs/FLUX.1-schnell
|
19 |
- black-forest-labs/FLUX.1-dev
|
20 |
-
- codellama/CodeLlama-34b-Instruct-hf
|
21 |
-
- meta-llama/Llama-2-13b-chat-hf
|
22 |
-
- meta-llama/Meta-Llama-3.1-405B-Instruct-FP8
|
23 |
-
- mistralai/Mistral-7B-Instruct-v0.2
|
24 |
-
- NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
|
25 |
---
|
26 |
# ⚡ API Inference
|
27 |
|
28 |
[Streamlit](https://streamlit.io) app for running inference on generative AI endpoints.
|
29 |
|
30 |
-
## Configuration
|
31 |
-
|
32 |
-
Streamlit [configuration](https://docs.streamlit.io/develop/concepts/configuration/options) has the following priority order:
|
33 |
-
1. `streamlit run` flags (highest priority)
|
34 |
-
2. environment variables
|
35 |
-
3. local config file
|
36 |
-
4. global config file
|
37 |
-
|
38 |
-
So you can deploy the local config and override with environment variables as necessary:
|
39 |
-
|
40 |
-
```bash
|
41 |
-
STREAMLIT_LOGGER_LEVEL=error
|
42 |
-
STREAMLIT_CLIENT_SHOW_ERROR_DETAILS=false
|
43 |
-
STREAMLIT_CLIENT_TOOLBAR_MODE=viewer
|
44 |
-
STREAMLIT_SERVER_FILE_WATCHER_TYPE=none
|
45 |
-
STREAMLIT_SERVER_RUN_ON_SAVE=false
|
46 |
-
STREAMLIT_BROWSER_SERVER_ADDRESS=adamelliotfields-api-inference.hf.space
|
47 |
-
```
|
48 |
-
|
49 |
## Secrets
|
50 |
|
|
|
|
|
51 |
```bash
|
|
|
52 |
FAL_KEY=...
|
53 |
HF_TOKEN=...
|
54 |
-
|
55 |
```
|
56 |
|
57 |
## Installation
|
58 |
|
|
|
|
|
59 |
```sh
|
60 |
# clone
|
61 |
git clone https://huggingface.co/spaces/adamelliotfields/api-inference.git
|
62 |
cd api-inference
|
63 |
-
git remote set-url origin https://adamelliotfields:$HF_TOKEN@huggingface.co/spaces/adamelliotfields/api-inference
|
64 |
|
65 |
# install
|
66 |
-
|
67 |
source .venv/bin/activate
|
68 |
-
pip install -r requirements.txt
|
69 |
|
70 |
# run
|
71 |
python app.py
|
72 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
# https://huggingface.co/docs/hub/en/spaces-config-reference
|
3 |
title: API Inference
|
4 |
+
short_description: Inference on many API endpoints
|
5 |
emoji: ⚡
|
6 |
colorFrom: blue
|
7 |
colorTo: green
|
8 |
sdk: streamlit
|
9 |
sdk_version: 1.37.1
|
10 |
python_version: 3.11.9
|
11 |
+
suggested_hardware: cpu-basic
|
12 |
app_file: 0_🏠_Home.py
|
13 |
full_width: true
|
14 |
pinned: true
|
15 |
+
header: default
|
16 |
license: apache-2.0
|
17 |
models:
|
|
|
18 |
- black-forest-labs/FLUX.1-schnell
|
19 |
- black-forest-labs/FLUX.1-dev
|
|
|
|
|
|
|
|
|
|
|
20 |
---
|
21 |
# ⚡ API Inference
|
22 |
|
23 |
[Streamlit](https://streamlit.io) app for running inference on generative AI endpoints.
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
## Secrets
|
26 |
|
27 |
+
Setting keys as environment variables persists them so you don't have to enter them on every page load.
|
28 |
+
|
29 |
```bash
|
30 |
+
BFL_API_KEY=...
|
31 |
FAL_KEY=...
|
32 |
HF_TOKEN=...
|
33 |
+
PPLX_API_KEY=...
|
34 |
```
|
35 |
|
36 |
## Installation
|
37 |
|
38 |
+
Recommend [uv](https://github.com/astral-sh/uv).
|
39 |
+
|
40 |
```sh
|
41 |
# clone
|
42 |
git clone https://huggingface.co/spaces/adamelliotfields/api-inference.git
|
43 |
cd api-inference
|
|
|
44 |
|
45 |
# install
|
46 |
+
uv venv
|
47 |
source .venv/bin/activate
|
48 |
+
uv pip install -r requirements.txt
|
49 |
|
50 |
# run
|
51 |
python app.py
|
52 |
```
|
53 |
+
|
54 |
+
## Development
|
55 |
+
|
56 |
+
```sh
|
57 |
+
git remote set-url origin https://adamelliotfields:$HF_TOKEN@huggingface.co/spaces/adamelliotfields/api-inference
|
58 |
+
```
|