Spaces:
Sleeping
Sleeping
|
Download README.md from abstikatech/AbstikaAI: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/abstikatech/AbstikaAI/resolve/main/README.md
- Command line
-
hf download hf://spaces/abstikatech/AbstikaAI/README.md
-
curl -L -o README.md https://huggingface.co/spaces/abstikatech/AbstikaAI/resolve/main/README.md
1.43 kB
| title: AbstikaTestLLM | |
| emoji: 🐨 | |
| colorFrom: blue | |
| colorTo: pink | |
| sdk: docker | |
| pinned: false | |
| license: mit | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
| # FastAPI Sample Project | |
| This is a simple FastAPI application with sample GET and POST endpoints for testing. | |
| ## Features | |
| - **GET /**: Returns a greeting message. | |
| - **POST /items/**: Accepts a JSON body with `name` and `description` fields and returns the item. | |
| ## Requirements | |
| - Python 3.9+ | |
| - [FastAPI](https://fastapi.tiangolo.com/) | |
| - [Uvicorn](https://www.uvicorn.org/) | |
| ## Installation & Running Locally | |
| 1. Install dependencies: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 2. Start the server: | |
| ```bash | |
| uvicorn main:app --reload | |
| ``` | |
| 3. Open your browser at [http://127.0.0.1:8000](http://127.0.0.1:8000) | |
| ## API Examples | |
| ### GET / | |
| ```bash | |
| curl http://127.0.0.1:8000/ | |
| ``` | |
| ### POST /items/ | |
| ```bash | |
| curl -X POST "http://127.0.0.1:8000/items/" -H "Content-Type: application/json" -d '{"name": "Sample Item", "description": "A test item."}' | |
| ``` | |
| ## Docker Usage | |
| 1. Build the Docker image: | |
| ```bash | |
| docker build -t fastapi-sample . | |
| ``` | |
| 2. Run the container: | |
| ```bash | |
| docker run -p 7860:7860 fastapi-sample | |
| ``` | |
| 3. The app will be available at [http://localhost:7860](http://localhost:7860) | |
| --- | |
| For more information, see the [FastAPI documentation](https://fastapi.tiangolo.com/). | |