My first commit
This commit is contained in:
@@ -6,4 +6,4 @@
|
|||||||
"cloudpickle": "3.1"
|
"cloudpickle": "3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4
auto_classes.json
Normal file
4
auto_classes.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"AutoConfig": "hello.EchoConfig",
|
||||||
|
"AutoAgent": "hello.EchoAgent"
|
||||||
|
}
|
||||||
25
hello.py
Normal file
25
hello.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
from modaic import PrecompiledAgent, PrecompiledConfig
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
|
class EchoConfig(PrecompiledConfig):
|
||||||
|
lm: str = "gpt-4o"
|
||||||
|
|
||||||
|
class EchoAgent(PrecompiledAgent):
|
||||||
|
config: EchoConfig # ! Important: config must be annotated with the config class
|
||||||
|
|
||||||
|
def __init__(self, config: EchoConfig):
|
||||||
|
super().__init__(config)
|
||||||
|
|
||||||
|
def forward(self, text: str) -> str:
|
||||||
|
return f"Echo: {text}"
|
||||||
|
|
||||||
|
agent = EchoAgent(EchoConfig())
|
||||||
|
print(agent(text="hello"))
|
||||||
|
agent.push_to_hub(
|
||||||
|
"connor/CrossEncoderRanker",
|
||||||
|
with_code=True,
|
||||||
|
commit_message="My first commit"
|
||||||
|
)
|
||||||
7
pyproject.toml
Normal file
7
pyproject.toml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[project]
|
||||||
|
name = "CrossEncoderRanker"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Add your description here"
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.11"
|
||||||
|
dependencies = ["modaic>=0.4.1", "weaviate-client>=4.18.1"]
|
||||||
Reference in New Issue
Block a user