Akjava commited on
Commit
4adfe65
·
verified ·
1 Parent(s): 3f30de8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -27,14 +27,14 @@ def init():
27
  histories = []
28
  #model = None
29
 
30
-
31
-
32
- if not is_hugging_face:
33
- model = AutoModelForCausalLM.from_pretrained(
34
  model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
35
  )
36
- text_generator = pipeline("text-generation", model=model, tokenizer=tokenizer,torch_dtype=dtype,device_map=device ) #pipeline has not to(device)
37
-
 
 
 
38
  if next(model.parameters()).is_cuda:
39
  print("The model is on a GPU")
40
  else:
 
27
  histories = []
28
  #model = None
29
 
30
+ model = AutoModelForCausalLM.from_pretrained(
 
 
 
31
  model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
32
  )
33
+ text_generator = pipeline("text-generation", model=model, tokenizer=tokenizer,torch_dtype=dtype,device_map=device ) #pipeline has not to(device)
34
+
35
+
36
+ if not is_hugging_face:
37
+
38
  if next(model.parameters()).is_cuda:
39
  print("The model is on a GPU")
40
  else: