Skip to content

Commit

Permalink
removed unnecessary imports (rasbt#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-kleine authored Sep 22, 2024
1 parent 76e9a9e commit 5f36d2a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ch06/04_user_interface/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def get_model_and_tokenizer():
model.out_head = torch.nn.Linear(in_features=GPT_CONFIG_124M["emb_dim"], out_features=num_classes)

# Then load model weights
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
checkpoint = torch.load(model_path, map_location=device, weights_only=True)
model.load_state_dict(checkpoint)
model.to(device)
Expand All @@ -71,7 +70,6 @@ async def main(message: chainlit.Message):
The main Chainlit function.
"""
user_input = message.content
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

label = classify_review(user_input, model, tokenizer, device, max_length=120)

Expand Down

0 comments on commit 5f36d2a

Please sign in to comment.