Add MODAIC token support and fix init to accept kwargs
This commit is contained in:
11
ce_ranker.py
11
ce_ranker.py
@@ -3,7 +3,7 @@ import os
|
||||
import asyncio
|
||||
|
||||
import dspy
|
||||
from modaic import PrecompiledAgent, PrecompiledConfig
|
||||
from modaic import PrecompiledProgram, PrecompiledConfig
|
||||
import weaviate
|
||||
|
||||
load_dotenv()
|
||||
@@ -22,7 +22,7 @@ class CERankerConfig(PrecompiledConfig):
|
||||
lm: str = "openai/gpt-4.1-mini"
|
||||
|
||||
|
||||
class CERankerAgent(PrecompiledAgent):
|
||||
class CERankerAgent(PrecompiledProgram):
|
||||
config: CERankerConfig
|
||||
|
||||
def __init__(self, config: CERankerConfig, **kwargs):
|
||||
@@ -73,10 +73,9 @@ if __name__ == "__main__":
|
||||
return_properties=["content"],
|
||||
k=5
|
||||
)
|
||||
agent = CERankerAgent(config)
|
||||
print(agent(query="What is HyDE?"))
|
||||
agent.push_to_hub(
|
||||
reranker = CERankerAgent(config)
|
||||
reranker.push_to_hub(
|
||||
"connor/CrossEncoderRanker",
|
||||
with_code=True,
|
||||
commit_message="Fix init to accept kwargs"
|
||||
commit_message="Add MODAIC token support and fix init to accept kwargs"
|
||||
)
|
||||
Reference in New Issue
Block a user