Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ def server(input, output, session):
|
|
| 79 |
#print(f"Downloading {input.model()} to {input.model_folder()}")
|
| 80 |
hf_download(
|
| 81 |
model_name="quickmt/" + input.model(),
|
| 82 |
-
output_dir=Path("/
|
| 83 |
)
|
| 84 |
return "Model downloaded"
|
| 85 |
|
|
@@ -87,12 +87,12 @@ def server(input, output, session):
|
|
| 87 |
@reactive.event(input.translate_button) # Take a dependency on the button
|
| 88 |
def translate():
|
| 89 |
global t
|
| 90 |
-
model_path = Path("/
|
| 91 |
|
| 92 |
if not model_path.exists():
|
| 93 |
hf_download(
|
| 94 |
model_name="quickmt/" + input.model(),
|
| 95 |
-
output_dir=Path("/
|
| 96 |
)
|
| 97 |
try:
|
| 98 |
if t is None or str(input.model()) != str(Path(t.model_path).name):
|
|
|
|
| 79 |
#print(f"Downloading {input.model()} to {input.model_folder()}")
|
| 80 |
hf_download(
|
| 81 |
model_name="quickmt/" + input.model(),
|
| 82 |
+
output_dir=Path("/code/models") / input.model(),
|
| 83 |
)
|
| 84 |
return "Model downloaded"
|
| 85 |
|
|
|
|
| 87 |
@reactive.event(input.translate_button) # Take a dependency on the button
|
| 88 |
def translate():
|
| 89 |
global t
|
| 90 |
+
model_path = Path("/code/models") / input.model()
|
| 91 |
|
| 92 |
if not model_path.exists():
|
| 93 |
hf_download(
|
| 94 |
model_name="quickmt/" + input.model(),
|
| 95 |
+
output_dir=Path("/code/models") / input.model(),
|
| 96 |
)
|
| 97 |
try:
|
| 98 |
if t is None or str(input.model()) != str(Path(t.model_path).name):
|