vilarin commited on
Commit
351363f
·
verified ·
1 Parent(s): f77fb99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -36,9 +36,17 @@ device = "cuda" # for GPU usage or "cpu" for CPU usage
36
  tokenizer = AutoTokenizer.from_pretrained(MODEL)
37
  model = AutoModelForCausalLM.from_pretrained(
38
  MODEL,
39
- torch_dtype=torch.bfloat16,
 
40
  device_map="auto")
41
 
 
 
 
 
 
 
 
42
 
43
 
44
  @spaces.GPU()
 
36
  tokenizer = AutoTokenizer.from_pretrained(MODEL)
37
  model = AutoModelForCausalLM.from_pretrained(
38
  MODEL,
39
+ torch_dtype=torch.float16,
40
+ low_cpu_mem_usage=True,
41
  device_map="auto")
42
 
43
+ pipeline = transformers.pipeline(
44
+ "text-generation",
45
+ model=model_id,
46
+ model_kwargs={"torch_dtype": torch.bfloat16},
47
+ device_map="auto",
48
+ )
49
+
50
 
51
 
52
  @spaces.GPU()