Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ This tool provides an intuitive drag-and-drop interface that empowers developers
<img src="https://github.com/user-attachments/assets/3499f9df-f0ed-49a7-ac69-0bf1d80318c6" alt="DL-Playground Demo" width="100%">
</a>

---

## Getting Started

To get the application running locally, follow these steps.

### 1. Clone the Repository

```bash
git clone https://github.com/your-username/DL-Playground.git
cd DL-Playground
```

### 2. Run the setup script (Docker required)

```bash
chmod +x setup.sh
./setup.sh
```

The frontend will be available at `http://localhost:7000`. Open this URL in your browser to start using the playground!

---

Expand Down Expand Up @@ -54,33 +75,6 @@ This tool provides an intuitive drag-and-drop interface that empowers developers

---

## Getting Started

To get the application running locally, follow these steps.

### 1. Clone the Repository

```bash
git clone https://github.com/your-username/DL-Playground.git
cd DL-Playground
```

### 2. Build the Torchlens image

```bash
docker build -t torchlens-worker:latest ./backend/
```

### 3. Build docker compose

```bash
docker compose up -d --build
```

The frontend will be available at `http://localhost:7000`. Open this URL in your browser to start using the playground!

---

## How to Use

1. **Open the Application**: Navigate to the frontend URL in your browser.
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ function FlowContent() {
reader.onload = ev => {
try {
const parsed = JSON.parse(String(ev.target?.result));

setNodes(parsed.nodes);
setEdges(parsed.edges);
} catch (err) {
console.error("Failed to import graph", err);
alert("Failed to import graph JSON.");
Expand Down
22 changes: 22 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

IMAGE_NAME="torchlens-worker:latest"

echo "Pulling latest changes from main..."
git pull origin main

echo "Checking if Docker image '$IMAGE_NAME' exists..."

if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then
echo "Image not found. Building Docker image..."
docker build -t $IMAGE_NAME ./backend/
else
echo "Image already exists. Skipping build."
fi

echo "Starting Docker Compose..."
docker compose up -d --build

echo "Setup complete!"