Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ research
# virtual environment for Python projects
.venv

# Ignore the .vscode directory, which contains project-specific settings for Visual Studio Code
.vscode

7 changes: 7 additions & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ Please provide your name in alphabetical order, as follows:
- Domain: benchmark.ethics
---

---
- Name: Khatibul Haque
- GitHub: [khateeb-haq](https://github.com/khateeb-haq)
- Role: Develop
- Domain: benchmark.persistence
---


2 changes: 1 addition & 1 deletion src/edyant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _check_ollama(url: str, timeout: float = 1.0) -> bool:
return False


def _start_ollama(bin_path: str, host: str, port: int, wait_secs: float = 8.0) -> subprocess.Popen:
def _start_ollama(bin_path: str, host: str, port: int, wait_secs: float = 8.0) -> subprocess.Popen[str]:
try:
proc = subprocess.Popen( # noqa: S603
[bin_path, "serve"],
Expand Down
4 changes: 2 additions & 2 deletions src/edyant/persistence/adapters/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
) -> None:
super().__init__(model)
self._model = model
self._url = url or os.getenv("OLLAMA_API_URL")
self._url: str = url or os.getenv("OLLAMA_API_URL") or ""
if not self._url:
raise ValueError(
"OllamaAdapter requires a URL via the 'url' argument or the OLLAMA_API_URL environment variable"
Expand All @@ -38,7 +38,7 @@ def __init__(

def generate(self, prompt: str, **kwargs: Any) -> ModelOutput:
"""Send a prompt to Ollama and return the response."""
payload = {
payload: dict[str, str | bool] = {
"model": self._model,
"prompt": prompt,
"stream": False,
Expand Down