nateraw commited on
Commit
eb5f8c6
β€’
1 Parent(s): 9b7a4e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -109,7 +109,9 @@ class Pipeline:
109
  text = ""
110
  with torch.autocast(self.device):
111
  for start, stop, frames in iter_clips(video_path):
112
- text += f"{'-'*30} Predictions From: {start:2.3f}-{stop:2.3f} seconds {'-'*30}\n"
 
 
113
  frames = self.val_transform(frames).unsqueeze(0)
114
  if self.device == 'cuda':
115
  frames = frames.to(self.device).half()
@@ -129,7 +131,9 @@ class Pipeline:
129
  )
130
  for i in range(num_return_sequences):
131
  generated_text_str = self.decode_one(generated_text_ids[i], self.tokenizer)
132
- text += '\t{}: {}\n'.format(i, generated_text_str)
 
 
133
  return text
134
 
135
  interface = gr.Interface(
 
109
  text = ""
110
  with torch.autocast(self.device):
111
  for start, stop, frames in iter_clips(video_path):
112
+ text_to_add = f"{'-'*30} Predictions From: {start:2.3f}-{stop:2.3f} seconds {'-'*30}\n"
113
+ print(text_to_add)
114
+ text += text_to_add
115
  frames = self.val_transform(frames).unsqueeze(0)
116
  if self.device == 'cuda':
117
  frames = frames.to(self.device).half()
 
131
  )
132
  for i in range(num_return_sequences):
133
  generated_text_str = self.decode_one(generated_text_ids[i], self.tokenizer)
134
+ text_to_add = '\t{}: {}\n'.format(i, generated_text_str)
135
+ print(text_to_add)
136
+ text += text_to_add
137
  return text
138
 
139
  interface = gr.Interface(