(no commit message)

This commit is contained in:
2026-04-19 20:52:08 -07:00
parent cd45f9e000
commit 63b86001a0
20 changed files with 134 additions and 2 deletions

32
program/program.py Normal file
View File

@@ -0,0 +1,32 @@
import sys
from modaic import PrecompiledProgram
from .config import AgentWRetreiverConfig
from .retriever import ExampleRetriever
from .tools.google.google_search import search_google # noqa: F401
from .utils.used import random_util # noqa: F401
class AgentWRetreiver(PrecompiledProgram):
config: AgentWRetreiverConfig
def __init__(self, config: AgentWRetreiverConfig, retriever: ExampleRetriever, **kwargs):
super().__init__(config, retriever=retriever, **kwargs)
self.lm = self.config.lm
self.clients = self.config.clients
def forward(self, query: str) -> str:
return self.retriever.retrieve(query)
if __name__ == "__main__":
from pathlib import Path
username = sys.argv[1] # ← first arg after script name (username)
config = AgentWRetreiverConfig(num_fetch=1)
retriever = ExampleRetriever(config, needed_param="hi")
program = AgentWRetreiver(config, retriever=retriever)
repo_path = f"{username}/nested_repo_3"
extra = str(Path(__file__).resolve().parent.parent.parent.parent / "extra_files" / "extra.yaml")
program.push_to_hub(repo_path, with_code=True, extra_files=[extra])