Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,8 @@ def bergamot(input_text: str = Query(description="Input strings"), sl: str = 'de
|
|
| 114 |
repo_id="TiberiuCristianLeon/Bergamot"
|
| 115 |
branches = ['base', 'base-memory', 'tiny']
|
| 116 |
subfolder = f"{sl}{tl}"
|
| 117 |
-
|
|
|
|
| 118 |
all_files = list_repo_files(repo_id, repo_type='model')
|
| 119 |
print(len(all_files), 'installed_pairs', installed_pairs)
|
| 120 |
for branch in branches:
|
|
@@ -127,9 +128,7 @@ def bergamot(input_text: str = Query(description="Input strings"), sl: str = 'de
|
|
| 127 |
if subfolder not in installed_pairs:
|
| 128 |
local_path = hf_hub_download(repo_id=repo_id, subfolder=model_name, filename=file_path, local_dir=subfolder)
|
| 129 |
print(f"Downloaded to: {local_path}") # Downloaded to: deen/base/deen/config.yml
|
| 130 |
-
localfolder = local_path.rsplit('/', 1)[0]
|
| 131 |
-
else:
|
| 132 |
-
localfolder = f"{subfolder}/{model_name}"
|
| 133 |
installed_pairs.add(subfolder)
|
| 134 |
print('installed_pairs', installed_pairs, 'localfolder', localfolder)
|
| 135 |
model = service.modelFromConfigPath(f"{localfolder}/config.yml")
|
|
|
|
| 114 |
repo_id="TiberiuCristianLeon/Bergamot"
|
| 115 |
branches = ['base', 'base-memory', 'tiny']
|
| 116 |
subfolder = f"{sl}{tl}"
|
| 117 |
+
localfolder = f"{subfolder}/{model_name}"
|
| 118 |
+
# List all files in the repo
|
| 119 |
all_files = list_repo_files(repo_id, repo_type='model')
|
| 120 |
print(len(all_files), 'installed_pairs', installed_pairs)
|
| 121 |
for branch in branches:
|
|
|
|
| 128 |
if subfolder not in installed_pairs:
|
| 129 |
local_path = hf_hub_download(repo_id=repo_id, subfolder=model_name, filename=file_path, local_dir=subfolder)
|
| 130 |
print(f"Downloaded to: {local_path}") # Downloaded to: deen/base/deen/config.yml
|
| 131 |
+
# localfolder = local_path.rsplit('/', 1)[0]
|
|
|
|
|
|
|
| 132 |
installed_pairs.add(subfolder)
|
| 133 |
print('installed_pairs', installed_pairs, 'localfolder', localfolder)
|
| 134 |
model = service.modelFromConfigPath(f"{localfolder}/config.yml")
|