(no commit message)
This commit is contained in:
0
__init__.py
Normal file
0
__init__.py
Normal file
4
auto_classes.json
Normal file
4
auto_classes.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"AutoConfig": "modaic.PrecompiledConfig",
|
||||||
|
"AutoProgram": "summarizer.Summarizer"
|
||||||
|
}
|
||||||
3
config.json
Normal file
3
config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"model": null
|
||||||
|
}
|
||||||
28
program.json
Normal file
28
program.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"predict": {
|
||||||
|
"traces": [],
|
||||||
|
"train": [],
|
||||||
|
"demos": [],
|
||||||
|
"signature": {
|
||||||
|
"instructions": "Given the fields `input`, produce the fields `summary`.",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"prefix": "Input:",
|
||||||
|
"description": "${input}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefix": "Summary:",
|
||||||
|
"description": "${summary}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lm": null
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"dependency_versions": {
|
||||||
|
"python": "3.11",
|
||||||
|
"dspy": "3.0.4",
|
||||||
|
"cloudpickle": "3.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
pyproject.toml
Normal file
7
pyproject.toml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[project]
|
||||||
|
name = "summarizer"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Add your description here"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.11"
|
||||||
|
dependencies = ["dspy>=3.0.4", "ipykernel>=7.1.0", "langfuse>=3.11.1", "modaic>=0.8.1", "modal>=1.3.0.post1", "openinference-instrumentation>=0.1.42", "openinference-instrumentation-dspy>=0.1.32"]
|
||||||
11
summarizer.py
Normal file
11
summarizer.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from modaic import PrecompiledProgram
|
||||||
|
import dspy
|
||||||
|
|
||||||
|
|
||||||
|
class Summarizer(PrecompiledProgram):
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
self.predict = dspy.Predict("input -> summary")
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
def forward(self, input: str) -> str:
|
||||||
|
return self.predict(input=input)
|
||||||
Reference in New Issue
Block a user