Skip to content

Commit

Permalink
Update vllm.py (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
den-run-ai authored Oct 24, 2024
1 parent adadbd2 commit 2042663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion textgrad/engine/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ def __init__(
self,
model_string="meta-llama/Meta-Llama-3-8B-Instruct",
system_prompt=DEFAULT_SYSTEM_PROMPT,
**llm_config,
):
root = platformdirs.user_cache_dir("textgrad")
cache_path = os.path.join(root, f"cache_vllm_{model_string}.db")
super().__init__(cache_path=cache_path)

self.model_string = model_string
self.system_prompt = system_prompt
self.client = LLM(self.model_string)
self.client = LLM(self.model_string, **llm_config)
self.tokenizer = self.client.get_tokenizer()

def generate(
Expand Down

0 comments on commit 2042663

Please sign in to comment.