Commit 23360257 authored by Your Name's avatar Your Name

Fix ModelManager.generate() to accept kwargs without passing to backend

parent e0293048
...@@ -142,11 +142,12 @@ class ModelManager: ...@@ -142,11 +142,12 @@ class ModelManager:
def generate(self, prompt: str, max_tokens: Optional[int] = None, def generate(self, prompt: str, max_tokens: Optional[int] = None,
temperature: float = 0.7, top_p: float = 1.0, temperature: float = 0.7, top_p: float = 1.0,
stop: Optional[List[str]] = None): stop: Optional[List[str]] = None, **kwargs):
"""Generate text non-streaming.""" """Generate text non-streaming."""
if self.backend is None: if self.backend is None:
raise RuntimeError("No model loaded") raise RuntimeError("No model loaded")
return self.backend.generate(prompt, max_tokens, temperature, top_p, stop) return self.backend.generate(prompt, max_tokens, temperature, top_p, stop)
def generate_chat(self, messages: List[Dict], max_tokens: Optional[int] = None, def generate_chat(self, messages: List[Dict], max_tokens: Optional[int] = None,
temperature: float = 0.7, top_p: float = 1.0, temperature: float = 0.7, top_p: float = 1.0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment