Skip to content

Commit

Permalink
Tokenizer to xpu
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Mar 7, 2024
1 parent 9ff1cf8 commit 6703787
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/python/transformers/transformers_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def Predict(self, request, context):
inputs = self.tokenizer(request.Prompt, return_tensors="pt").input_ids
if self.CUDA:
inputs = inputs.to("cuda")
if XPU:
inputs = inputs.to("xpu")

outputs = self.model.generate(inputs,max_new_tokens=max_tokens, temperature=request.Temperature, top_p=request.TopP)

Expand Down

0 comments on commit 6703787

Please sign in to comment.