[edit] update readme
Browse files
README.md
CHANGED
|
@@ -35,21 +35,21 @@ The model is trained to predict in the following schema
|
|
| 35 |
from enum import Enum
|
| 36 |
from pydantic import BaseModel
|
| 37 |
|
| 38 |
-
class
|
| 39 |
na = "na"
|
| 40 |
low = "low"
|
| 41 |
medium = "medium"
|
| 42 |
high = "high"
|
| 43 |
|
| 44 |
class EmotionLabel(BaseModel):
|
| 45 |
-
joy:
|
| 46 |
-
trust:
|
| 47 |
-
fear:
|
| 48 |
-
surprise:
|
| 49 |
-
sadness:
|
| 50 |
-
disgust:
|
| 51 |
-
anger:
|
| 52 |
-
anticipation:
|
| 53 |
|
| 54 |
class EntryResult(BaseModel):
|
| 55 |
emotion: EmotionLabel
|
|
@@ -81,7 +81,7 @@ input_text = tokenizer.apply_chat_template(
|
|
| 81 |
add_generation_prompt=True,
|
| 82 |
)
|
| 83 |
prediction = generator(input_text)
|
| 84 |
-
>>> EntryResult(emotion=EmotionLabel(joy=<
|
| 85 |
```
|
| 86 |
|
| 87 |
Using endpoint loaded with vllm & OpenAI client package
|
|
|
|
| 35 |
from enum import Enum
|
| 36 |
from pydantic import BaseModel
|
| 37 |
|
| 38 |
+
class EmotionLevel(str, Enum):
|
| 39 |
na = "na"
|
| 40 |
low = "low"
|
| 41 |
medium = "medium"
|
| 42 |
high = "high"
|
| 43 |
|
| 44 |
class EmotionLabel(BaseModel):
|
| 45 |
+
joy: EmotionLevel
|
| 46 |
+
trust: EmotionLevel
|
| 47 |
+
fear: EmotionLevel
|
| 48 |
+
surprise: EmotionLevel
|
| 49 |
+
sadness: EmotionLevel
|
| 50 |
+
disgust: EmotionLevel
|
| 51 |
+
anger: EmotionLevel
|
| 52 |
+
anticipation: EmotionLevel
|
| 53 |
|
| 54 |
class EntryResult(BaseModel):
|
| 55 |
emotion: EmotionLabel
|
|
|
|
| 81 |
add_generation_prompt=True,
|
| 82 |
)
|
| 83 |
prediction = generator(input_text)
|
| 84 |
+
>>> EntryResult(emotion=EmotionLabel(joy=<EmotionLevel.na: 'na'>, ...)
|
| 85 |
```
|
| 86 |
|
| 87 |
Using endpoint loaded with vllm & OpenAI client package
|