Skip to content

Commit

Permalink
Index
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollopy-tulane committed Apr 29, 2024
1 parent 5fabb9e commit 9353218
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nlp/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def index():
# For CNN, assuming preprocessing is handled differently or is built-in
text = basic_process(input_field)
text = cnn_process(text)
predictions_proba = cnn.predict([text])
predictions_proba = cnn.predict(text)
pred = (predictions_proba > 0.5).astype(int)[0] # Assuming binary classification
proba = predictions_proba[0]
elif model_choice == 'bert':
Expand All @@ -51,7 +51,6 @@ def index():
text = tokenizer(input_field, return_tensors="pt")
with torch.no_grad():
outputs = model(**text)

predicted_class = torch.argmax(outputs.logits).item()

return render_template('myform.html', title='', form=form,
Expand Down

0 comments on commit 9353218

Please sign in to comment.