HFHAB commited on
Commit
85c980a
1 Parent(s): 29b2045

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -3
main.py CHANGED
@@ -48,12 +48,16 @@ def generate(item: Item):
48
  print(text)
49
  labels = ["Requirement", "Information"]
50
  print(labels)
51
- stream = client.zero_shot_classification(text, labels)
52
- print("Stream: " + stream)
 
 
 
 
53
  #stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
54
  output = ""
55
 
56
- for response in stream:
57
  output += response.token.text
58
  return output
59
 
 
48
  print(text)
49
  labels = ["Requirement", "Information"]
50
  print(labels)
51
+ result = client.zero_shot_classification("The car shall be slow.", labels)
52
+ print("Predicted Labels:")
53
+ print(result["labels"][0], result["scores"][0])
54
+ print(result["labels"][1], result["scores"][1])
55
+ #stream = client.zero_shot_classification(text, labels)
56
+ #print("Stream: " + stream)
57
  #stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
58
  output = ""
59
 
60
+ for response in result:
61
  output += response.token.text
62
  return output
63