sarim commited on
Commit
c5224f2
·
1 Parent(s): 823af88
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -18,7 +18,8 @@ data = []
18
  model = GroqModel('llama-3.1-70b-versatile', api_key = api_key)
19
 
20
  def split_long_string(long_string, chunk_size=6000):
21
- return [long_string[i:i+chunk_size] for i in range(0, len(long_string), chunk_size)]
 
22
 
23
 
24
  async def ppt_content(data):
@@ -43,8 +44,9 @@ async def ppt_content(data):
43
 
44
 
45
  ))
46
- listOfString = split_long_string("".join(data))
47
- print(len(listOfString))
 
48
 
49
  # for x in listOfString:
50
  # result: RunResult[str] = RunResult(_all_messages:[])
@@ -69,6 +71,7 @@ def extract_data(feed):
69
  pages = pdf.pages
70
  for p in pages:
71
  data.append(p.extract_text())
 
72
  return None
73
 
74
 
 
18
  model = GroqModel('llama-3.1-70b-versatile', api_key = api_key)
19
 
20
  def split_long_string(long_string, chunk_size=6000):
21
+ string_data = "".join(long_string)
22
+ return [string_data[i:i+chunk_size] for i in range(0, len(string_data), chunk_size)]
23
 
24
 
25
  async def ppt_content(data):
 
44
 
45
 
46
  ))
47
+ listOfString = split_long_string(data)
48
+ for i, chunk in enumerate(listOfString, 1):
49
+ print(f"Chunk {i}:\n{chunk}\n")
50
 
51
  # for x in listOfString:
52
  # result: RunResult[str] = RunResult(_all_messages:[])
 
71
  pages = pdf.pages
72
  for p in pages:
73
  data.append(p.extract_text())
74
+ print(data)
75
  return None
76
 
77