[
https://issues.apache.org/jira/browse/BEAM-13972?focusedWorklogId=738946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-738946
]
ASF GitHub Bot logged work on BEAM-13972:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Mar/22 17:00
Start Date: 09/Mar/22 17:00
Worklog Time Spent: 10m
Work Description: ryanthompson591 commented on a change in pull request
#16917:
URL: https://github.com/apache/beam/pull/16917#discussion_r822868000
##########
File path: sdks/python/apache_beam/ml/inference/api.py
##########
@@ -15,38 +15,29 @@
# limitations under the License.
#
+import abc
from dataclasses import dataclass
-from enum import Enum
from typing import Tuple
from typing import TypeVar
from typing import Union
import apache_beam as beam
-class PyTorchDevice(Enum):
- CPU = 1
- GPU = 2
-
-
-class SklearnSerializationType(Enum):
- PICKLE = 1
- JOBLIB = 2
-
-
-@dataclass
class BaseModelSpec:
- model_uri: str
-
-
-@dataclass
-class PyTorchModelSpec(BaseModelSpec):
- device: PyTorchDevice
-
+ """
+ Model factory that returns ModelLoader and
+ InferenceRunner objects to be used
+ """
+ @abc.abstractmethod
+ def get_model_loader(self):
+ "Returns ModelLoader object"
Review comment:
I think this is good for now.
Just a note, but I don't think you need to do anything: Going forward it
seems to me that there will be an implementation that uses a service (instead
of loading model) a that maybe returns none for get_model_loader. I haven't
decided if this should return None by default or if a NotImplementedError is
fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 738946)
Time Spent: 10h 20m (was: 10h 10m)
> Implement RunInference common interface
> ---------------------------------------
>
> Key: BEAM-13972
> URL: https://issues.apache.org/jira/browse/BEAM-13972
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Andy Ye
> Assignee: Andy Ye
> Priority: P2
> Labels: run-inference
> Time Spent: 10h 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)