File size: 976 Bytes
931ee76 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/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/<your-username>/rustgen"
echo " git push -u origin main # or the branch the Space expects"
|