Daemontatox commited on
Commit
3365a48
·
verified ·
1 Parent(s): b4fc3f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -79,8 +79,8 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
79
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
80
 
81
  # Ensure the model is on the GPU
82
- #device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
83
- #model.to(device)
84
 
85
  # Create Hugging Face Pipeline with the specified model and tokenizer
86
  hf_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
 
79
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
80
 
81
  # Ensure the model is on the GPU
82
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
83
+ model.to(device)
84
 
85
  # Create Hugging Face Pipeline with the specified model and tokenizer
86
  hf_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)