Spaces:
Build error
Build error
Download scripts/sync_to_hf.py from Redlion007/LLM-and-RAG-Application-GenAI: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/spaces/Redlion007/LLM-and-RAG-Application-GenAI/resolve/main/scripts/sync_to_hf.py
- Command line
-
hf download hf://spaces/Redlion007/LLM-and-RAG-Application-GenAI/scripts/sync_to_hf.py
-
curl -L -o sync_to_hf.py https://huggingface.co/spaces/Redlion007/LLM-and-RAG-Application-GenAI/resolve/main/scripts/sync_to_hf.py
725 Bytes
| import os | |
| def sync_metadata(): | |
| metadata_file = 'metadata.yml' | |
| readme_file = 'README.md' | |
| output_file = 'README.hf.md' # This is what you would push to HF as README.md | |
| if not os.path.exists(metadata_file): | |
| print(f"Error: {metadata_file} not found.") | |
| return | |
| with open(metadata_file, 'r') as f: | |
| metadata = f.read() | |
| with open(readme_file, 'r') as f: | |
| readme_content = f.read() | |
| # Combine them with YAML delimiters | |
| full_content = f"---\n{metadata}---\n\n{readme_content}" | |
| with open(output_file, 'w') as f: | |
| f.write(full_content) | |
| print(f"Successfully created {output_file} with metadata prepended.") | |
| if __name__ == "__main__": | |
| sync_metadata() | |