MariaFilipkowska commited on
Commit
63374f2
·
verified ·
1 Parent(s): 08d66c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -5,6 +5,8 @@ import gradio as gr
5
  import requests
6
  import pandas as pd
7
  import base64
 
 
8
 
9
  from typing import TypedDict, Annotated
10
  from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage
@@ -14,7 +16,7 @@ from langgraph.graph import START, StateGraph
14
  from langgraph.graph.message import add_messages
15
  from langgraph.prebuilt import ToolNode, tools_condition
16
  from langchain_mistralai import ChatMistralAI
17
- import librosa
18
 
19
  import getpass
20
  import os
@@ -50,6 +52,8 @@ def get_ref_content(path: str) -> str | object:
50
  file = requests.get(path).content
51
  elif path.endswith('mp3'):
52
  file = librosa.load(path)
 
 
53
  else:
54
  with open(path, "rb") as f:
55
  file = f.read()
 
5
  import requests
6
  import pandas as pd
7
  import base64
8
+ import librosa
9
+ import openpyxl
10
 
11
  from typing import TypedDict, Annotated
12
  from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage
 
16
  from langgraph.graph.message import add_messages
17
  from langgraph.prebuilt import ToolNode, tools_condition
18
  from langchain_mistralai import ChatMistralAI
19
+
20
 
21
  import getpass
22
  import os
 
52
  file = requests.get(path).content
53
  elif path.endswith('mp3'):
54
  file = librosa.load(path)
55
+ elif path.endswith('xlsx') or path.endswith('xls'):
56
+ file = pd.read_excel(path)
57
  else:
58
  with open(path, "rb") as f:
59
  file = f.read()