13 lines
329 B
Python
13 lines
329 B
Python
from modaic import PrecompiledProgram
|
|
import dspy
|
|
|
|
|
|
class Summarizer(PrecompiledProgram):
|
|
def __init__(self, **kwargs):
|
|
super().__init__(**kwargs)
|
|
self.predict = dspy.Predict("input -> summary")
|
|
|
|
def forward(self, input: str) -> str:
|
|
input = input.strip()
|
|
return self.predict(input=input)
|