Skip to content

Commit

Permalink
move source dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Nov 8, 2024
1 parent db028a3 commit a3a55bb
Show file tree
Hide file tree
Showing 36 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,9 @@ cython_debug/
/model_dir/
/dataset_dir/
/repos/
/logs/
/logs/

*.key
*.csr
*.pem
*.crt
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "olah"
version = "0.3.3"
version = "0.3.4"
description = "Self-hosted lightweight huggingface mirror."
readme = "README.md"
requires-python = ">=3.8"
Expand All @@ -29,10 +29,11 @@ dev = ["black==24.10.0", "pylint==3.3.1", "pytest==8.3.3"]
olah-cli = "olah.server:cli"

[tool.setuptools.packages.find]
where = ["src"]
exclude = ["assets*", "benchmark*", "docs", "dist*", "playground*", "scripts*", "tests*"]

[tool.setuptools.package-data]
static = ["*.html"]
olah = ["static/*.html"]

[tool.wheel]
exclude = ["assets*", "benchmark*", "docs", "dist*", "playground*", "scripts*", "tests*"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions olah/constants.py → src/olah/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.

import os


WORKER_API_TIMEOUT = 15
CHUNK_SIZE = 4096
LFS_FILE_BLOCK = 64 * 1024 * 1024

DEFAULT_LOGGER_DIR = "./logs"
OLAH_CODE_DIR = os.path.dirname(os.path.abspath(__file__))

ORIGINAL_LOC = "oriloc"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions olah/server.py → src/olah/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
get_newest_commit_hf,
parse_org_repo,
)
from olah.constants import REPO_TYPES_MAPPING
from olah.constants import OLAH_CODE_DIR, REPO_TYPES_MAPPING
from olah.utils.logging import build_logger

logger = None
Expand Down Expand Up @@ -164,7 +164,7 @@ async def lifespan(app: FastAPI):
# ======================
code_file_path = os.path.abspath(__file__)
app = FastAPI(lifespan=lifespan, debug=False)
templates = Jinja2Templates(directory=os.path.join(os.path.dirname(code_file_path), "..", "static"))
templates = Jinja2Templates(directory=os.path.join(OLAH_CODE_DIR, "static"))


class AppSettings(BaseSettings):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a3a55bb

Please sign in to comment.