Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ from transformers import GenerationConfig
|
|
19 |
# from modelscope.hub.api import HubApi
|
20 |
from pydub import AudioSegment
|
21 |
import os
|
22 |
-
YOUR_ACCESS_TOKEN = os.getenv('YOUR_ACCESS_TOKEN')
|
23 |
|
24 |
# api = HubApi()
|
25 |
# api.login(YOUR_ACCESS_TOKEN)
|
@@ -49,7 +49,7 @@ def _get_args():
|
|
49 |
|
50 |
def _load_model_tokenizer(args):
|
51 |
tokenizer = AutoTokenizer.from_pretrained(
|
52 |
-
args.checkpoint_path, trust_remote_code=True, resume_download=True
|
53 |
)
|
54 |
|
55 |
if args.cpu_only:
|
@@ -65,7 +65,7 @@ def _load_model_tokenizer(args):
|
|
65 |
token=YOUR_ACCESS_TOKEN
|
66 |
).eval()
|
67 |
model.generation_config = GenerationConfig.from_pretrained(
|
68 |
-
args.checkpoint_path, trust_remote_code=True, resume_download=True
|
69 |
)
|
70 |
|
71 |
return model, tokenizer
|
|
|
19 |
# from modelscope.hub.api import HubApi
|
20 |
from pydub import AudioSegment
|
21 |
import os
|
22 |
+
# YOUR_ACCESS_TOKEN = os.getenv('YOUR_ACCESS_TOKEN')
|
23 |
|
24 |
# api = HubApi()
|
25 |
# api.login(YOUR_ACCESS_TOKEN)
|
|
|
49 |
|
50 |
def _load_model_tokenizer(args):
|
51 |
tokenizer = AutoTokenizer.from_pretrained(
|
52 |
+
args.checkpoint_path, trust_remote_code=True, resume_download=True #, token=YOUR_ACCESS_TOKEN
|
53 |
)
|
54 |
|
55 |
if args.cpu_only:
|
|
|
65 |
token=YOUR_ACCESS_TOKEN
|
66 |
).eval()
|
67 |
model.generation_config = GenerationConfig.from_pretrained(
|
68 |
+
args.checkpoint_path, trust_remote_code=True, resume_download=True #, token=YOUR_ACCESS_TOKEN
|
69 |
)
|
70 |
|
71 |
return model, tokenizer
|