|
Download COMANDOS.md from gusmoon/TutorIA: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/spaces/gusmoon/TutorIA/resolve/main/COMANDOS.md
- Command line
-
hf download hf://spaces/gusmoon/TutorIA/COMANDOS.md
-
curl -L -o COMANDOS.md https://huggingface.co/spaces/gusmoon/TutorIA/resolve/main/COMANDOS.md
1.9 kB
| # Comandos 脷tiles para Tutorial AI App | |
| ## Desarrollo Local | |
| ### Instalar dependencias | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ### Ejecutar aplicaci贸n localmente | |
| ```bash | |
| python app.py | |
| ``` | |
| ### Ejecutar pruebas autom谩ticas | |
| ```bash | |
| python test_local.py | |
| ``` | |
| ### Configurar variables de entorno | |
| ```bash | |
| cp .env.example .env | |
| # Editar .env con tus claves de API | |
| ``` | |
| ## Despliegue en Hugging Face | |
| ### Clonar tu Space | |
| ```bash | |
| git clone https://huggingface.co/spaces/tu-usuario/tu-space | |
| cd tu-space | |
| ``` | |
| ### Copiar archivos del proyecto | |
| ```bash | |
| cp -r /ruta/a/tutorial_ai_app_hf/* . | |
| ``` | |
| ### Desplegar cambios | |
| ```bash | |
| ./deploy.sh "Mensaje de commit opcional" | |
| ``` | |
| ### Despliegue manual | |
| ```bash | |
| git add . | |
| git commit -m "Descripci贸n de cambios" | |
| git push | |
| ``` | |
| ## Monitoreo y Debugging | |
| ### Ver logs en Hugging Face | |
| 1. Ve a tu Space en huggingface.co | |
| 2. Haz clic en "Logs" | |
| 3. Observa los logs en tiempo real | |
| ### Verificar estado de la aplicaci贸n | |
| ```bash | |
| curl https://tu-usuario-tu-space.hf.space/health | |
| ``` | |
| ### Probar API desde l铆nea de comandos | |
| ```bash | |
| # Generar tutorial | |
| curl -X POST https://tu-usuario-tu-space.hf.space/api/generate \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"topic": "Instalar Docker en Ubuntu"}' | |
| # Listar tutoriales | |
| curl https://tu-usuario-tu-space.hf.space/api/tutorials | |
| ``` | |
| ## Soluci贸n de Problemas | |
| ### La aplicaci贸n no inicia | |
| 1. Verificar logs en Hugging Face Spaces | |
| 2. Comprobar que app.py est茅 en la ra铆z | |
| 3. Verificar requirements.txt | |
| ### Error de importaci贸n | |
| 1. Verificar estructura de directorios | |
| 2. Comprobar archivos __init__.py | |
| 3. Revisar rutas de importaci贸n | |
| ### Problemas de memoria | |
| 1. Optimizar c贸digo para usar menos memoria | |
| 2. Considerar upgrade de hardware en HF Spaces | |
| 3. Implementar limpieza de memoria | |
| ### API no responde | |
| 1. Verificar que el puerto 7860 est茅 configurado | |
| 2. Comprobar configuraci贸n de CORS | |
| 3. Revisar logs de errores | |