Spaces:
Sleeping
Sleeping
|
Download README.md from learneng-space/quotes: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/learneng-space/quotes/resolve/main/README.md
- Command line
-
hf download hf://spaces/learneng-space/quotes/README.md
-
curl -L -o README.md https://huggingface.co/spaces/learneng-space/quotes/resolve/main/README.md
1.37 kB
| title: Quotes | |
| emoji: 🐨 | |
| colorFrom: pink | |
| colorTo: green | |
| sdk: docker | |
| pinned: false | |
| short_description: Quotes API Space | |
| # Quotes API Space | |
| This Hugging Face Space provides an API to fetch 50 random quotes from the [jstet/quotes-500k](https://huggingface.co/datasets/jstet/quotes-500k) dataset. | |
| ## Usage | |
| Send a GET request to `/api/quotes` to retrieve 50 random quotes. Example response: | |
| ```json | |
| { | |
| "quotes": [ | |
| {"quote": "Life is what happens when you're busy making other plans.", "author": "John Lennon", "category": "Life"}, | |
| ... | |
| ] | |
| } | |
| ``` | |
| ## Setup | |
| This Space uses the Docker Space SDK with Python, FastAPI, and the Hugging Face `datasets` library. The configuration is defined in the following files: | |
| - `Dockerfile`: Defines the Docker image. | |
| - `requirements.txt`: Lists Python dependencies. | |
| - `app.py`: Contains the FastAPI application code. | |
| ## Deployment | |
| To deploy this Space on Hugging Face: | |
| 1. Create a new Space on Hugging Face, selecting the Docker template. | |
| 2. Upload the `Dockerfile`, `requirements.txt`, `app.py`, and `README.md` files to the Space repository. | |
| 3. Configure the Space to use the Docker Space SDK. | |
| 4. Build and deploy the Space. | |
| The Space will be available at `https://<your-username>-<space-name>.hf.space/api/quotes`. | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference |