Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- Dockerfile +12 -0
- README.md +26 -4
- entrypoint.sh +37 -0
Dockerfile
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
RUN pip install --no-cache-dir aiohttp httpx huggingface_hub
|
| 6 |
+
|
| 7 |
+
COPY entrypoint.sh /entrypoint.sh
|
| 8 |
+
RUN chmod +x /entrypoint.sh
|
| 9 |
+
|
| 10 |
+
EXPOSE 7860
|
| 11 |
+
|
| 12 |
+
ENTRYPOINT ["/entrypoint.sh"]
|
README.md
CHANGED
|
@@ -1,10 +1,32 @@
|
|
| 1 |
---
|
| 2 |
-
title: Code
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Code Knowledge Graph Chat
|
| 3 |
+
emoji: 🦞
|
| 4 |
colorFrom: blue
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
+
license: mit
|
| 10 |
+
tags:
|
| 11 |
+
- code-visualization
|
| 12 |
+
- knowledge-graph
|
| 13 |
+
- architecture
|
| 14 |
+
- multi-project
|
| 15 |
+
short_description: Multi-project code knowledge graph chat with AI
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Multi-Project Code Knowledge Graph Dashboard
|
| 19 |
+
|
| 20 |
+
Interactive visualization and AI-powered chat for exploring multiple codebase architectures.
|
| 21 |
+
|
| 22 |
+
## Features
|
| 23 |
+
|
| 24 |
+
- **Multi-Project Support**: Auto-discovers projects under `data/projects/`
|
| 25 |
+
- **Knowledge Graph**: Interactive graph visualization with node details and source code
|
| 26 |
+
- **AI Chat**: DeepSeek-powered Q&A with tool-calling over the knowledge graph
|
| 27 |
+
- **Architecture Docs**: Chinese documentation with guided learning tours
|
| 28 |
+
- **Source Viewer**: Click any node to view its source code
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
Visit `/` to see the project selection page. Click a project card to enter its dashboard with graph visualization, source viewer, documentation browser, and AI chat.
|
entrypoint.sh
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
if [ -z "$HF_TOKEN" ]; then
|
| 5 |
+
echo "ERROR: HF_TOKEN not set."
|
| 6 |
+
exit 1
|
| 7 |
+
fi
|
| 8 |
+
|
| 9 |
+
VERSION="${HF_SOURCE_VERSION:-latest}"
|
| 10 |
+
FILENAME="code-kg-chat-${VERSION}.tar.gz"
|
| 11 |
+
|
| 12 |
+
echo "Downloading ${FILENAME} from ${HF_DATASET_ID}..."
|
| 13 |
+
python3 -c "
|
| 14 |
+
from huggingface_hub import hf_hub_download
|
| 15 |
+
import tarfile, os, shutil
|
| 16 |
+
|
| 17 |
+
path = hf_hub_download(
|
| 18 |
+
repo_id='${HF_DATASET_ID}',
|
| 19 |
+
filename='${FILENAME}',
|
| 20 |
+
repo_type='dataset',
|
| 21 |
+
token='${HF_TOKEN}',
|
| 22 |
+
)
|
| 23 |
+
print(f'Downloaded: {path}')
|
| 24 |
+
|
| 25 |
+
for item in os.listdir('/app'):
|
| 26 |
+
full = os.path.join('/app', item)
|
| 27 |
+
if os.path.isdir(full):
|
| 28 |
+
shutil.rmtree(full)
|
| 29 |
+
else:
|
| 30 |
+
os.remove(full)
|
| 31 |
+
|
| 32 |
+
with tarfile.open(path, 'r:gz') as tar:
|
| 33 |
+
tar.extractall('/app')
|
| 34 |
+
print('Extraction complete.')
|
| 35 |
+
"
|
| 36 |
+
|
| 37 |
+
exec python3 /app/server.py --auto-approve-source
|