Download app_hf.py from decodingdatascience/aiprojectideas: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/spaces/decodingdatascience/aiprojectideas/resolve/main/app_hf.py
- Command line
-
hf download hf://spaces/decodingdatascience/aiprojectideas/app_hf.py
-
curl -L -o app_hf.py https://huggingface.co/spaces/decodingdatascience/aiprojectideas/resolve/main/app_hf.py
514 Bytes
| import gradio as gr | |
| from ai_wrapper import AIProjectAssistant | |
| from typing import Tuple | |
| import os | |
| # For Hugging Face Spaces, get API key from environment variable | |
| API_KEY = os.environ.get("OPENAI_API_KEY") | |
| if not API_KEY: | |
| raise ValueError("No OpenAI API key found. Please set OPENAI_API_KEY in Hugging Face Spaces secrets.") | |
| # Initialize AI Assistant | |
| assistant = AIProjectAssistant(API_KEY) | |
| # Rest of your code from app.py... | |
| # (Copy everything else from app.py, starting from PROJECT_OPTIONS) |