Daemontatox commited on
Commit
ee642b9
·
verified ·
1 Parent(s): a1ebba4

Update app.py

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