lsb commited on
Commit
1d80a44
·
1 Parent(s): 34d125a

float16 for cuda

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -6,7 +6,7 @@ import torch
6
  """
7
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
8
  """
9
- pipe = transformers.pipeline("text-generation", "HuggingFaceTB/SmolLM-135M-Instruct", torch_dtype=torch.float32)
10
  outlines_tokenizer = outlines.models.TransformerTokenizer(pipe.tokenizer)
11
 
12
  ### TODO 1: use outliunes with a transformer model made directly
 
6
  """
7
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
8
  """
9
+ pipe = transformers.pipeline("text-generation", "HuggingFaceTB/SmolLM-1.7B-Instruct", torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32)
10
  outlines_tokenizer = outlines.models.TransformerTokenizer(pipe.tokenizer)
11
 
12
  ### TODO 1: use outliunes with a transformer model made directly