seungheondoh
commited on
Commit
β’
ab464b2
1
Parent(s):
1fe02e5
error fix
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ state_dict = pretrained_object['state_dict']
|
|
23 |
model.load_state_dict(state_dict)
|
24 |
if torch.cuda.is_available():
|
25 |
torch.cuda.set_device(device)
|
26 |
-
model = model.cuda(device)
|
27 |
model.eval()
|
28 |
|
29 |
def get_audio(audio_path, duration=10, target_sr=16000):
|
@@ -47,7 +47,7 @@ def get_audio(audio_path, duration=10, target_sr=16000):
|
|
47 |
|
48 |
def captioning(audio_path):
|
49 |
audio_tensor = get_audio(audio_path = audio_path)
|
50 |
-
if
|
51 |
audio_tensor = audio_tensor.to(device)
|
52 |
with torch.no_grad():
|
53 |
output = model.generate(
|
|
|
23 |
model.load_state_dict(state_dict)
|
24 |
if torch.cuda.is_available():
|
25 |
torch.cuda.set_device(device)
|
26 |
+
model = model.cuda(device)
|
27 |
model.eval()
|
28 |
|
29 |
def get_audio(audio_path, duration=10, target_sr=16000):
|
|
|
47 |
|
48 |
def captioning(audio_path):
|
49 |
audio_tensor = get_audio(audio_path = audio_path)
|
50 |
+
if torch.cuda.is_available():
|
51 |
audio_tensor = audio_tensor.to(device)
|
52 |
with torch.no_grad():
|
53 |
output = model.generate(
|