Skip to content

Commit

Permalink
add: netlify.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincentqyw committed Oct 5, 2024
1 parent 2fbd111 commit 829c0bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RUN apt-get update && apt-get install -y git-lfs
RUN git lfs install

# Clone the Git repository
# RUN git clone https://huggingface.co/spaces/Realcat/image-matching-webui /code
RUN git clone --recursive https://github.com/Vincentqyw/image-matching-webui.git /code

RUN conda create -n imw python=${PYTHON_VERSION}
Expand Down
14 changes: 10 additions & 4 deletions api/client.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import os
import argparse
import pickle
import time
from typing import Dict

import numpy as np
import requests
from loguru import logger

API_URL_MATCH = "http://127.0.0.1:8001/v1/match"
API_URL_EXTRACT = "http://127.0.0.1:8001/v1/extract"
API_URL_EXTRACT_V2 = "http://127.0.0.1:8001/v2/extract"
URL = "http://127.0.0.1:8001"
if "REMOTE_URL_RAILWAY" in os.environ:
URL = os.environ["REMOTE_URL_RAILWAY"]

logger.info(f"API URL: {URL}")

API_URL_MATCH = f"{URL}/v1/match"
API_URL_EXTRACT = f"{URL}/v1/extract"
API_URL_EXTRACT_V2 = f"{URL}/v2/extract"


def send_generate_request(path0: str, path1: str) -> Dict[str, np.ndarray]:
Expand Down
11 changes: 11 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build]
command = "pip install -r requirements.txt && python server.py"
publish = "."

[context.production.environment]
PYTHON_VERSION = "3.10.10"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200

0 comments on commit 829c0bc

Please sign in to comment.