Rauhan commited on
Commit
21acacc
·
1 Parent(s): 4581a9c

UPDATE: ThreadPoolExecutor

Browse files
Files changed (1) hide show
  1. functions.py +2 -3
functions.py CHANGED
@@ -299,8 +299,7 @@ def getTextFromImagePDF(pdfBytes):
299
  global reader
300
  return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
301
  allImages = convert_from_bytes(pdfBytes)
302
- with ThreadPoolExecutor(max_workers = 5) as p:
303
- texts = list(p.map(getText, allImages))
304
  return "\n\n\n".join(texts)
305
 
306
  def getTranscript(urls: str):
@@ -320,7 +319,7 @@ def getTranscript(urls: str):
320
 
321
 
322
  def analyzeData(query, dataframe):
323
- llm = ChatGroq(name = "gemma2-9b-it")
324
  df = SmartDataframe(dataframe, config = {"llm": llm, "verbose": False})
325
  response = df.chat(query)
326
  if os.path.isfile(response):
 
299
  global reader
300
  return "\n".join([text[1] for text in reader.readtext(np.array(image), paragraph=True)])
301
  allImages = convert_from_bytes(pdfBytes)
302
+ texts = [getText(image) for image in allImages]
 
303
  return "\n\n\n".join(texts)
304
 
305
  def getTranscript(urls: str):
 
319
 
320
 
321
  def analyzeData(query, dataframe):
322
+ llm = ChatGroq(name = "llama-3.1-8b-instant")
323
  df = SmartDataframe(dataframe, config = {"llm": llm, "verbose": False})
324
  response = df.chat(query)
325
  if os.path.isfile(response):