Staticaliza commited on
Commit
48ebe09
·
verified ·
1 Parent(s): 5a25e75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -52,19 +52,19 @@ def generate(input=[], instruction=DEFAULT_INPUT, sampling=False, temperature=0.
52
  print(instruction)
53
 
54
  content = []
55
- if not files:
56
  return "No input provided."
57
 
58
- for file_path in files:
59
- ext = os.path.splitext(file_path)[1].lower()
60
  if ext in [".jpg", ".jpeg", ".png", ".bmp", ".gif"]:
61
- img = Image.open(file_path).convert("RGB")
62
  content.append(img)
63
  elif ext in [".mp4", ".mov", ".avi", ".mkv"]:
64
- frames = encode_video(file_path)
65
  content.extend(frames)
66
  elif ext in [".wav", ".mp3", ".flac", ".aac"]:
67
- aud, _ = librosa.load(file_path, sr=16000, mono=True)
68
  content.append(aud)
69
  else:
70
  continue
 
52
  print(instruction)
53
 
54
  content = []
55
+ if not input:
56
  return "No input provided."
57
 
58
+ for path in input:
59
+ ext = os.path.splitext(path)[1].lower()
60
  if ext in [".jpg", ".jpeg", ".png", ".bmp", ".gif"]:
61
+ img = Image.open(path).convert("RGB")
62
  content.append(img)
63
  elif ext in [".mp4", ".mov", ".avi", ".mkv"]:
64
+ frames = encode_video(path)
65
  content.extend(frames)
66
  elif ext in [".wav", ".mp3", ".flac", ".aac"]:
67
+ aud, _ = librosa.load(path, sr=16000, mono=True)
68
  content.append(aud)
69
  else:
70
  continue