Spaces:
Running
Running
narugo1992
commited on
Commit
•
89491e5
1
Parent(s):
ad47846
dev(narugo): fix bug on skins
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import gradio as gr
|
|
6 |
import markdown
|
7 |
import pandas as pd
|
8 |
from gchar.games.dispatch.access import get_character
|
|
|
9 |
from gchar.resources.pixiv import get_pixiv_keywords, get_pixiv_posts
|
10 |
from gchar.resources.sites import list_available_sites, get_site_tag
|
11 |
from gchar.utils import get_requests_session
|
@@ -17,8 +18,6 @@ from character import get_ch_name
|
|
17 |
from civitai import try_find_title
|
18 |
from huggingface import get_hf_fs
|
19 |
|
20 |
-
from gchar.generic import import_generic
|
21 |
-
|
22 |
import_generic()
|
23 |
|
24 |
hf_fs = get_hf_fs()
|
@@ -50,14 +49,14 @@ def query(chr_name):
|
|
50 |
info_df = pd.DataFrame(columns=info_columns, data=info_data)
|
51 |
|
52 |
# get skins
|
53 |
-
skin_dir = f'datasets/
|
54 |
meta_json = f'{skin_dir}/.meta.json'
|
55 |
skin_urls = []
|
56 |
if hf_fs.exists(meta_json):
|
57 |
meta = json.loads(hf_fs.read_text(meta_json))
|
58 |
for item in meta['files']:
|
59 |
skin_url = hf_hub_url(
|
60 |
-
|
61 |
filename=f'{ch.__game_name__}/{ch.index}/{item["name"]}',
|
62 |
repo_type='dataset',
|
63 |
)
|
|
|
6 |
import markdown
|
7 |
import pandas as pd
|
8 |
from gchar.games.dispatch.access import get_character
|
9 |
+
from gchar.generic import import_generic
|
10 |
from gchar.resources.pixiv import get_pixiv_keywords, get_pixiv_posts
|
11 |
from gchar.resources.sites import list_available_sites, get_site_tag
|
12 |
from gchar.utils import get_requests_session
|
|
|
18 |
from civitai import try_find_title
|
19 |
from huggingface import get_hf_fs
|
20 |
|
|
|
|
|
21 |
import_generic()
|
22 |
|
23 |
hf_fs = get_hf_fs()
|
|
|
49 |
info_df = pd.DataFrame(columns=info_columns, data=info_data)
|
50 |
|
51 |
# get skins
|
52 |
+
skin_dir = f'datasets/{ch.__skin_repository__}/{ch.__game_name__}/{ch.index}'
|
53 |
meta_json = f'{skin_dir}/.meta.json'
|
54 |
skin_urls = []
|
55 |
if hf_fs.exists(meta_json):
|
56 |
meta = json.loads(hf_fs.read_text(meta_json))
|
57 |
for item in meta['files']:
|
58 |
skin_url = hf_hub_url(
|
59 |
+
ch.__skin_repository__,
|
60 |
filename=f'{ch.__game_name__}/{ch.index}/{item["name"]}',
|
61 |
repo_type='dataset',
|
62 |
)
|