Thanh Vinh Vo commited on
Commit
f89b8c9
·
1 Parent(s): 0ba08eb
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,7 +4,6 @@ import os
4
  import gradio as gr
5
  import pandas as pd
6
  import requests
7
- from html_to_markdown import convert_to_markdown
8
  from smolagents import (
9
  CodeAgent,
10
  DuckDuckGoSearchTool,
@@ -26,6 +25,8 @@ def html_to_markdown(arg1: str) -> str: # it's important to specify the return
26
  Args:
27
  arg1: the raw HTML string to convert
28
  """
 
 
29
  return convert_to_markdown(arg1)
30
 
31
 
@@ -35,9 +36,9 @@ class BasicAgent:
35
  def __init__(self):
36
  print("BasicAgent initialized.")
37
  self.agent = CodeAgent(
38
- tools=[],
39
  model=InferenceClientModel(),
40
- additional_authorized_imports=["requests", "bs4"],
41
  max_steps=10,
42
  )
43
 
 
4
  import gradio as gr
5
  import pandas as pd
6
  import requests
 
7
  from smolagents import (
8
  CodeAgent,
9
  DuckDuckGoSearchTool,
 
25
  Args:
26
  arg1: the raw HTML string to convert
27
  """
28
+ from html_to_markdown import convert_to_markdown
29
+
30
  return convert_to_markdown(arg1)
31
 
32
 
 
36
  def __init__(self):
37
  print("BasicAgent initialized.")
38
  self.agent = CodeAgent(
39
+ tools=["html_to_markdown"],
40
  model=InferenceClientModel(),
41
+ additional_authorized_imports=["requests", "bs4", "html_to_markdown"],
42
  max_steps=10,
43
  )
44