Skip to content

Commit

Permalink
feat: Block stderr when loading tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
saattrupdan committed May 22, 2024
1 parent 837ce28 commit 14e5d33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ragger/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import os
import subprocess
import sys
import typing
from time import sleep

Expand Down Expand Up @@ -205,7 +206,11 @@ def __init__(self, config: DictConfig) -> None:
"Please ensure that a compatible GPU is available and try again."
)

# Load the tokenizer without printing any logs
sys.stderr = open(os.devnull, "w")
self.tokenizer = AutoTokenizer.from_pretrained(config.generator.model)
sys.stderr = sys.__stderr__

config.generator.server = "0.0.0.0"
self.server_process = self.start_inference_server()
else:
Expand Down

0 comments on commit 14e5d33

Please sign in to comment.