yetessam commited on
Commit
bffba19
·
verified ·
1 Parent(s): 6d0b2ce

Update tools/polite_guard.py

Browse files
Files changed (1) hide show
  1. tools/polite_guard.py +14 -14
tools/polite_guard.py CHANGED
@@ -33,17 +33,17 @@ class PoliteGuardTool(Tool):
33
 
34
  #@tool
35
  def ask_polite_guard(self, input_text: str) -> tuple[str,int]:
36
- """
37
-
38
- Args:
39
- input_text: The text to classify.
40
-
41
- Returns:
42
- tuple: with classification label and the score
43
- """
44
- try:
45
- classifier = pipeline("text-classification", "Intel/polite-guard")
46
- return classifier(input_text)
47
-
48
- except Exception as e:
49
- return f"Error fetching classification for text '{input_text}': {str(e)}"
 
33
 
34
  #@tool
35
  def ask_polite_guard(self, input_text: str) -> tuple[str,int]:
36
+ """
37
+
38
+ Args:
39
+ input_text: The text to classify.
40
+
41
+ Returns:
42
+ tuple: with classification label and the score
43
+ """
44
+ try:
45
+ classifier = pipeline("text-classification", "Intel/polite-guard")
46
+ return classifier(input_text)
47
+
48
+ except Exception as e:
49
+ return f"Error fetching classification for text '{input_text}': {str(e)}"