Former-commit-id: 5cf0e201f803a1308f1b1b7ef20065b9615d05b0
pull/160/head
Kye 2 years ago
parent a5af0d509d
commit e9f2b6e913

@ -27,7 +27,7 @@ class HuggingFaceLLM:
except Exception as e:
self.logger.error(f"Failed to load the model or the tokenizer: {e}")
raise
def generate_text(self, prompt_text: str, max_length: int = None):
def generate(self, prompt_text: str, max_length: int = None):
max_length = max_length if max_length else self.max_length
try:
inputs = self.tokenizer.encode(prompt_text, return_tensors="pt").to(self.device)

Loading…
Cancel
Save