Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def transcribe(inputs, prompt):
|
|
41 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
42 |
prompt = "γ" if not prompt else prompt
|
43 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
44 |
-
result = pipe(inputs, generate_kwargs=generate_kwargs)
|
45 |
return result['text'][1 + len(prompt) + 1:]
|
46 |
|
47 |
def _return_yt_html_embed(yt_url):
|
@@ -86,7 +86,7 @@ def yt_transcribe(yt_url, prompt, max_filesize=75.0):
|
|
86 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
87 |
prompt = "γ" if not prompt else prompt
|
88 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
89 |
-
result = pipe(inputs, generate_kwargs=generate_kwargs)
|
90 |
return html_embed_str, result['text'][1 + len(prompt) + 1:]
|
91 |
|
92 |
|
|
|
41 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
42 |
prompt = "γ" if not prompt else prompt
|
43 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
44 |
+
result = pipe(inputs, generate_kwargs=generate_kwargs)
|
45 |
return result['text'][1 + len(prompt) + 1:]
|
46 |
|
47 |
def _return_yt_html_embed(yt_url):
|
|
|
86 |
generate_kwargs = {"language": "japanese", "task": "transcribe"}
|
87 |
prompt = "γ" if not prompt else prompt
|
88 |
generate_kwargs['prompt_ids'] = pipe.tokenizer.get_prompt_ids(prompt, return_tensors='pt').to(device)
|
89 |
+
result = pipe(inputs, generate_kwargs=generate_kwargs)
|
90 |
return html_embed_str, result['text'][1 + len(prompt) + 1:]
|
91 |
|
92 |
|