CoolFace
Apppublic

lamminhtungquan/weather-forecast

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Weather Forecast API on Hugging Face Spaces

This repository is configured to run as a Docker Space on Hugging Face.

Space URL:

  • —https://huggingface.co/spaces/lamminhtungquan/weather-forecast
  • —https://lamminhtungquan-weather-forecast.hf.space

API endpoints

  • —GET /
  • —POST /smart-predict
  • —POST /auto-irrigation
  • —GET /docs

Notes

  • —The app stores irrigation schedules in irrigation_db.json.
  • —On Hugging Face Spaces, local file storage is not guaranteed to be persistent forever.
  • —For demo usage, the current setup is acceptable.
  • —For production persistence, move schedule data to an external database.

Local run

Run with Python

bash
pip install -r requirements.txt
python app.py

Open:

  • —http://127.0.0.1:8000/docs

Run with Docker

bash
docker build -t weather-forecast .
docker run --rm -p 8000:8000 weather-forecast

Open:

  • —http://127.0.0.1:8000/docs

Deploy to Hugging Face Spaces

  1. 1.Create a new Space on Hugging Face
  2. 2.Choose Docker as the SDK
  3. 3.Push this repository to the Space repository at lamminhtungquan/weather-forecast
  4. 4.Wait for the build to finish
  5. 5.Open /docs on the Space URL to test the API