Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -48,12 +48,16 @@ def generate(item: Item):
|
|
| 48 |
print(text)
|
| 49 |
labels = ["Requirement", "Information"]
|
| 50 |
print(labels)
|
| 51 |
-
|
| 52 |
-
print("
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
#stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 54 |
output = ""
|
| 55 |
|
| 56 |
-
for response in
|
| 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 |
|