Sneaksie commited on
Commit
0af384d
·
verified ·
1 Parent(s): 166ff30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import datetime
3
  import requests
4
  import pytz
5
  import yaml
 
6
  from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
@@ -17,6 +18,7 @@ def string_counter(substring:str, bigstring:str)-> str: #it's import to specify
17
  bigstring: a larger string inside the first parameter is found
18
  """
19
  try:
 
20
  count = len(re.findall(substring, bigstring))
21
  return f"{substring} is found {count} times in the string {bigstring}"
22
  except Exception as e:
 
3
  import requests
4
  import pytz
5
  import yaml
6
+ import re
7
  from tools.final_answer import FinalAnswerTool
8
 
9
  from Gradio_UI import GradioUI
 
18
  bigstring: a larger string inside the first parameter is found
19
  """
20
  try:
21
+ # Count how many times substring is found in bigstring
22
  count = len(re.findall(substring, bigstring))
23
  return f"{substring} is found {count} times in the string {bigstring}"
24
  except Exception as e: