Rafiq Rosman commited on
Commit
96df57d
·
1 Parent(s): 5c4d7fa

Added is_initialized to singlish translator tool

Browse files
Files changed (1) hide show
  1. tools/singlish_translator.py +4 -2
tools/singlish_translator.py CHANGED
@@ -8,7 +8,9 @@ class SinglishTranslatorTool(Tool):
8
  output_type = "string"
9
 
10
  def __init__(self):
 
11
  self.client = InferenceClient("h2oai/danube2-singlish-finetuned")
12
-
 
13
  def forward(self, text: str) -> str:
14
- return self.client.text_generation(prompt=text) # Correct method call
 
8
  output_type = "string"
9
 
10
  def __init__(self):
11
+ super().__init__() # Ensure Tool is properly initialized
12
  self.client = InferenceClient("h2oai/danube2-singlish-finetuned")
13
+ self.is_initialized = True # Required by smolagents.Tool
14
+
15
  def forward(self, text: str) -> str:
16
+ return self.client.text_generation(prompt=text) # Correct API call