Spaces:
Configuration error
Configuration error
Update
Browse files
README.md
CHANGED
|
@@ -1,30 +1,11 @@
|
|
| 1 |
-
# Robot AI Space (Hugging Face Space template)
|
| 2 |
|
| 3 |
-
This repository contains a minimal Flask backend suitable for deploying as a Hugging Face Space
|
| 4 |
-
to serve as the "brain" of an ESP32 robot. The Space uses the Hugging Face Inference API
|
| 5 |
-
(you must set HF_TOKEN in Space Secrets/Variables) to perform:
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
## Files
|
| 12 |
-
- `app.py` : Flask app implementing endpoints:
|
| 13 |
-
- `GET /health`
|
| 14 |
-
- `POST /upload_audio` (accepts raw WAV bytes, returns JSON {"text","reply","tts_file"})
|
| 15 |
-
- `POST /ask` (accepts JSON {"text":"..."} returns {"text","tts_file"})
|
| 16 |
-
- `GET /tts/<file>` (serves WAV files)
|
| 17 |
-
- `requirements.txt` : dependencies
|
| 18 |
-
|
| 19 |
-
## Deploy on Hugging Face Spaces
|
| 20 |
-
1. Create a new Space (framework: Gradio or Streamlit or "Static" with backend support).
|
| 21 |
-
2. Upload `app.py` and `requirements.txt`.
|
| 22 |
-
3. In the Space settings -> Secrets/Variables add `HF_TOKEN` with your Hugging Face Access Token.
|
| 23 |
-
You can also set `HF_STT_MODEL`, `HF_LLM_MODEL`, `HF_TTS_MODEL` to override defaults.
|
| 24 |
-
4. Space will build and run. The public URL will be like `https://<username>-<space>.hf.space`.
|
| 25 |
-
5. Use that URL as `server_ai` in your ESP32 WebConfig.
|
| 26 |
-
|
| 27 |
-
## Notes
|
| 28 |
-
- The inference API may be rate-limited or slow on large models; consider smaller models for faster responses.
|
| 29 |
-
- Ensure TTS model returns WAV bytes; if it returns MP3 you may need to convert on server or adjust ESP32 to decode MP3.
|
| 30 |
-
- This template is intentionally minimal; you can extend caching, user/session, logging, or model-specific parsing.
|
|
|
|
|
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
title: kcrobot-ai
|
| 4 |
+
emoji: 📊
|
| 5 |
+
colorFrom: pink
|
| 6 |
+
colorTo: blue8
|
| 7 |
+
sdk: gradio
|
| 8 |
+
sdk_version: 5.49.0
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: false
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|