kingabzpro commited on
Commit
9b12e6c
·
1 Parent(s): 41a4967

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,11 +1,15 @@
 
1
  import transformers
2
- import gradio as gr
3
 
4
  model = "tiiuae/falcon-rw-1b"
5
 
 
6
  pipeline = transformers.pipeline(
7
  "text-generation",
8
  model=model,
 
 
9
  trust_remote_code=True,
10
  device_map="auto",
11
  )
 
1
+ from transformers import AutoTokenizer
2
  import transformers
3
+ import torch
4
 
5
  model = "tiiuae/falcon-rw-1b"
6
 
7
+ tokenizer = AutoTokenizer.from_pretrained(model)
8
  pipeline = transformers.pipeline(
9
  "text-generation",
10
  model=model,
11
+ tokenizer=tokenizer,
12
+ torch_dtype=torch.bfloat16,
13
  trust_remote_code=True,
14
  device_map="auto",
15
  )