diff --git a/README.md b/README.md index fd815f3..e69de29 100644 --- a/README.md +++ b/README.md @@ -1 +0,0 @@ -# Testing Push to Modaic Hub \ No newline at end of file diff --git a/agent.json b/agent.json index bb0bb70..23da2b4 100644 --- a/agent.json +++ b/agent.json @@ -6,4 +6,4 @@ "cloudpickle": "3.1" } } -} +} \ No newline at end of file diff --git a/auto_classes.json b/auto_classes.json new file mode 100644 index 0000000..6685e21 --- /dev/null +++ b/auto_classes.json @@ -0,0 +1,4 @@ +{ + "AutoConfig": "hello.EchoConfig", + "AutoAgent": "hello.EchoAgent" +} \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..fa6cf8b --- /dev/null +++ b/hello.py @@ -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" +) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a7d5bba --- /dev/null +++ b/pyproject.toml @@ -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"]