rwitz commited on
Commit
f2c19e5
1 Parent(s): f554271

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -4,10 +4,10 @@ import time
4
  import torch
5
  sleep_time = int(os.environ.get('SLEEP_TIME', 3))
6
  # Use a pipeline as a high-level helper
7
- from transformers import pipeline
8
  # Load model directly
9
-
10
- pipe = pipeline("text-generation", model="mistralai/Mistral-7B-v0.1",device=0,torch_dtype=torch.bfloat16)
11
  ## load your model(s) into vram here
12
 
13
  def handler(event):
 
4
  import torch
5
  sleep_time = int(os.environ.get('SLEEP_TIME', 3))
6
  # Use a pipeline as a high-level helper
7
+ from transformers import pipeline, AutoTokenizer
8
  # Load model directly
9
+ tokenizer=AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1",skip_special_tokens=False)
10
+ pipe = pipeline("text-generation", model="mistralai/Mistral-7B-v0.1",tokenizer=tokenizer, device=0,torch_dtype=torch.bfloat16)
11
  ## load your model(s) into vram here
12
 
13
  def handler(event):