MariaFilipkowska commited on
Commit
fe8ebf3
·
verified ·
1 Parent(s): 60ba2a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -48,12 +48,12 @@ def get_file_path(question: str) -> str:
48
 
49
  def get_ref_content(path: str) -> str | object:
50
  """Retrieves content from the reference path provided."""
51
- if path.endswith('mp3'):
52
  file = librosa.load(path)
53
  elif path.endswith('.xlsx') or path.endswith('.xls'):
54
  file = pd.read_excel(path).to_json()
55
  elif path.startswith('http'):
56
- file = requests.get(path).text
57
  else:
58
  with open(path, "rb") as f:
59
  file = f.read()
 
48
 
49
  def get_ref_content(path: str) -> str | object:
50
  """Retrieves content from the reference path provided."""
51
+ if path.endswith('mp3') or file startswith('https://www.youtube.com/'):
52
  file = librosa.load(path)
53
  elif path.endswith('.xlsx') or path.endswith('.xls'):
54
  file = pd.read_excel(path).to_json()
55
  elif path.startswith('http'):
56
+ file = requests.get(path).content
57
  else:
58
  with open(path, "rb") as f:
59
  file = f.read()