Spaces:
Runtime error
Runtime error
Commit
·
204e8d8
1
Parent(s):
9f88a9b
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,12 +40,14 @@ def init_model():
|
|
| 40 |
model = LLaMa(args)
|
| 41 |
torch.set_default_tensor_type(torch.FloatTensor)
|
| 42 |
model = load_model(model, args.load_model_path)
|
| 43 |
-
print('load model done.')
|
| 44 |
model.eval()
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 47 |
model.to(device)
|
| 48 |
-
print('to cuda.')
|
| 49 |
lm_generation = LmGeneration(model, args.tokenizer)
|
| 50 |
|
| 51 |
|
|
|
|
| 40 |
model = LLaMa(args)
|
| 41 |
torch.set_default_tensor_type(torch.FloatTensor)
|
| 42 |
model = load_model(model, args.load_model_path)
|
|
|
|
| 43 |
model.eval()
|
| 44 |
|
| 45 |
+
for name, parameter in model.named_parameters():
|
| 46 |
+
print(name)
|
| 47 |
+
print(parameter)
|
| 48 |
+
print(torch.cuda.max_memory_allocated() / 1024 ** 3)
|
| 49 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 50 |
model.to(device)
|
|
|
|
| 51 |
lm_generation = LmGeneration(model, args.tokenizer)
|
| 52 |
|
| 53 |
|