ManifoldRG / NEKO

In Progress Implementation of GATO style Generalist Multimodal model capable of image, text, RL and Robotics tasks
https://discord.gg/brsPnzNd8h
GNU General Public License v3.0
38 stars 9 forks source link

Update TaskType references to use enum, not str #35

Closed eihli closed 5 months ago

eihli commented 7 months ago

<Enum>.value has type str, which could be anything. This PR updates all references of type TaskTypeEnum to be checks against the Enum itself rather than it's value.

eihli commented 5 months ago

Better yet, I think we should update all of these to use isinstance(task, [TextTask | ControlTask]) rather than task.task_type == TaskTypeEnum.[TextTask | ControlTask] because isinstance provides type narrowing which lets our IDEs provide us helpful info.

See the image below for an example. In this case, it doesn't really matter, because the type complaint is about things that coerce to Falsey either way. But I still think it's a worthwhile change.

image

bhavul commented 5 months ago

Looks good to me, but requires conflicts to be resolved @eihli :)