Spaces:
Runtime error
Runtime error
sandeshrajx
commited on
Commit
•
7e2c859
1
Parent(s):
8c7cd96
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from huggingface_hub import hf_hub_download
|
3 |
import subprocess
|
4 |
import tempfile
|
5 |
import shutil
|
@@ -13,14 +13,9 @@ print ("starting the app.")
|
|
13 |
|
14 |
def download_t5_model(model_id, save_directory):
|
15 |
# Modelin tokenizer'ını ve modeli indir
|
16 |
-
model = T5ForConditionalGeneration.from_pretrained(model_id)
|
17 |
-
tokenizer = T5Tokenizer.from_pretrained(model_id)
|
18 |
-
|
19 |
-
# Model ve tokenizer'ı belirtilen dizine kaydet
|
20 |
if not os.path.exists(save_directory):
|
21 |
os.makedirs(save_directory)
|
22 |
-
|
23 |
-
tokenizer.save_pretrained(save_directory)
|
24 |
|
25 |
# Model ID ve kaydedilecek dizin
|
26 |
model_id = "DeepFloyd/t5-v1_1-xxl"
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface_hub import hf_hub_download, snapshot_download
|
3 |
import subprocess
|
4 |
import tempfile
|
5 |
import shutil
|
|
|
13 |
|
14 |
def download_t5_model(model_id, save_directory):
|
15 |
# Modelin tokenizer'ını ve modeli indir
|
|
|
|
|
|
|
|
|
16 |
if not os.path.exists(save_directory):
|
17 |
os.makedirs(save_directory)
|
18 |
+
snapshot_download(repo_id="DeepFloyd/t5-v1_1-xxl",local_dir=save_directory, local_dir_use_symlinks=False)
|
|
|
19 |
|
20 |
# Model ID ve kaydedilecek dizin
|
21 |
model_id = "DeepFloyd/t5-v1_1-xxl"
|