mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-29 10:42:03 +00:00
Downloader: Fix handling of include pattern
If an include or exclude pattern is provided, include should include all files by default. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -121,7 +121,7 @@ async def hf_repo_download(
|
|||||||
repo_type = "lora"
|
repo_type = "lora"
|
||||||
|
|
||||||
if include or exclude:
|
if include or exclude:
|
||||||
include_patterns = unwrap(include, [])
|
include_patterns = unwrap(include, ["*"])
|
||||||
exclude_patterns = unwrap(exclude, [])
|
exclude_patterns = unwrap(exclude, [])
|
||||||
|
|
||||||
file_list = [
|
file_list = [
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from pydantic import BaseModel, Field
|
|||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
|
def _generate_include_list():
|
||||||
|
return ["*"]
|
||||||
|
|
||||||
|
|
||||||
class DownloadRequest(BaseModel):
|
class DownloadRequest(BaseModel):
|
||||||
"""Parameters for a HuggingFace repo download."""
|
"""Parameters for a HuggingFace repo download."""
|
||||||
|
|
||||||
@@ -10,7 +14,7 @@ class DownloadRequest(BaseModel):
|
|||||||
folder_name: Optional[str] = None
|
folder_name: Optional[str] = None
|
||||||
revision: Optional[str] = None
|
revision: Optional[str] = None
|
||||||
token: Optional[str] = None
|
token: Optional[str] = None
|
||||||
include: List[str] = Field(default_factory=list)
|
include: List[str] = Field(default_factory=_generate_include_list)
|
||||||
exclude: List[str] = Field(default_factory=list)
|
exclude: List[str] = Field(default_factory=list)
|
||||||
chunk_limit: Optional[int] = None
|
chunk_limit: Optional[int] = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user