#!/usr/bin/env bash # Assemble a complete Hugging Face Space directory in place: copy the rustgen # package and the RAG corpus next to the Space files so the folder can be pushed # to huggingface.co as-is. Safe to re-run (it refreshes the copies). set -euo pipefail here="$(cd "$(dirname "$0")" && pwd)" root="$(cd "$here/../.." && pwd)" rm -rf "$here/rustgen" cp -r "$root/rustgen" "$here/rustgen" find "$here/rustgen" -name '__pycache__' -type d -prune -exec rm -rf {} + mkdir -p "$here/data" cp "$root/data/rust_corpus_qwen.jsonl" "$here/data/rust_corpus_qwen.jsonl" echo "Space assembled in: $here" echo echo "Files ready to push:" ls -1 "$here" echo echo "Next: create a Gradio Space at https://huggingface.co/new-space then" echo " cd \"$here\"" echo " git init && git add -A && git commit -m 'RustGen demo'" echo " git remote add origin https://huggingface.co/spaces//rustgen" echo " git push -u origin main # or the branch the Space expects"