Tag wiki fix
This commit is contained in:
@@ -20,7 +20,7 @@ MODEL_PRESETS_PATH = str(ROOT_DIR / "model_presets.toml")
|
|||||||
RES_PRESETS_PATH = str(ROOT_DIR / "resolution_presets.toml")
|
RES_PRESETS_PATH = str(ROOT_DIR / "resolution_presets.toml")
|
||||||
TAG_DATABASE_PATH = str(ROOT_DIR / "danbooru.csv")
|
TAG_DATABASE_PATH = str(ROOT_DIR / "danbooru.csv")
|
||||||
TAG_SEARCH_LIMIT = 20
|
TAG_SEARCH_LIMIT = 20
|
||||||
ENABLE_TAG_WIKI = False
|
ENABLE_TAG_WIKI = True
|
||||||
DANBOORU_LOGIN = "" # Your Danbooru username (Optional)
|
DANBOORU_LOGIN = "" # Your Danbooru username (Optional)
|
||||||
DANBOORU_API_KEY = "" # Your Danbooru API key (Optional)
|
DANBOORU_API_KEY = "" # Your Danbooru API key (Optional)
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ async def _fetch_wiki_info(tag_name: str) -> Optional[str]:
|
|||||||
|
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
wiki_body = data.get("wiki_page", {}).get("body")
|
wiki_body = data.get("body")
|
||||||
if wiki_body:
|
if wiki_body:
|
||||||
# Strip HTML tags for the LLM
|
# Strip HTML tags for the LLM
|
||||||
return re.sub(r'<[^>]*>', '', wiki_body).strip()
|
return re.sub(r'<[^>]*>', '', wiki_body).strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user