Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,8 @@ streamer = TextStreamer(tokenizer)
|
|
32 |
|
33 |
model = AutoModelForCausalLM.from_pretrained(model, trust_remote_code=True, device_map="cuda")
|
34 |
model = PeftModel.from_pretrained(model, peft_model)
|
|
|
|
|
35 |
model.to(device)
|
36 |
|
37 |
model = model.eval()
|
|
|
32 |
|
33 |
model = AutoModelForCausalLM.from_pretrained(model, trust_remote_code=True, device_map="cuda")
|
34 |
model = PeftModel.from_pretrained(model, peft_model)
|
35 |
+
|
36 |
+
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
37 |
model.to(device)
|
38 |
|
39 |
model = model.eval()
|