Download Brain/src/model/feedback_model.py from ttt246/brain: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/spaces/ttt246/brain/resolve/main/Brain/src/model/feedback_model.py
- Command line
-
hf download hf://spaces/ttt246/brain/Brain/src/model/feedback_model.py
-
curl -L -o feedback_model.py https://huggingface.co/spaces/ttt246/brain/resolve/main/Brain/src/model/feedback_model.py
698 Bytes
| import datetime | |
| # feedback model to manage user's feedback (thumb up and down) | |
| from Brain.src.model.basic_model import BasicModel | |
| class FeedbackModel: | |
| def __init__( | |
| self, uuid: str, prompt: BasicModel, completion: BasicModel, rating: int | |
| ): | |
| self.uuid = uuid | |
| self.prompt = prompt | |
| self.completion = completion | |
| self.rating = rating | |
| self.timestamp = datetime.datetime.now().timestamp() | |
| def to_json(self): | |
| return { | |
| "uuid": self.uuid, | |
| "prompt": self.prompt.to_json(), | |
| "completion": self.completion.to_json(), | |
| "rating": self.rating, | |
| "timestamp": self.timestamp, | |
| } | |