Spaces:
Build error
Build error
Download deploy.py from atamalik/SmartResearcher: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/atamalik/SmartResearcher/resolve/main/deploy.py
- Command line
-
hf download hf://spaces/atamalik/SmartResearcher/deploy.py
-
curl -L -o deploy.py https://huggingface.co/spaces/atamalik/SmartResearcher/resolve/main/deploy.py
1.04 kB
| import os | |
| from huggingface_hub import HfApi | |
| from dotenv import load_dotenv | |
| # Load environment variables | |
| load_dotenv() | |
| # Get Hugging Face token | |
| HF_TOKEN = os.getenv("HF_TOKEN") | |
| if not HF_TOKEN: | |
| raise ValueError("HF_TOKEN not found in environment variables") | |
| # Initialize Hugging Face Hub client | |
| api = HfApi(token=HF_TOKEN) | |
| # Files to upload | |
| files_to_upload = [ | |
| "app.py", | |
| "deep_research.py", | |
| "research_manager.py", | |
| "Search_Evaluator.py", | |
| "planner_agent.py", | |
| "email_agent.py", | |
| "writer_agent.py", | |
| "search_agent.py", | |
| "agents.py", | |
| "requirements.txt", | |
| "README.md" | |
| ] | |
| # Upload each file | |
| for file in files_to_upload: | |
| if os.path.exists(file): | |
| print(f"Uploading {file}...") | |
| api.upload_file( | |
| path_or_fileobj=file, | |
| path_in_repo=file, | |
| repo_id="atamalik/SmartResearcher", | |
| repo_type="space" | |
| ) | |
| print(f"Successfully uploaded {file}") | |
| else: | |
| print(f"Warning: {file} not found") | |
| print("Deployment completed!") |