raja-7-c commited on
Commit
5c4dc00
1 Parent(s): 0b6d06f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -420,10 +420,9 @@ def predict(text):
420
  input_a = np.asarray([window_input])
421
  pred = Modell.predict(input_a, batch_size=None, verbose=0, steps=None)
422
  #print(pred)
423
- predictions.append(pred)
424
- accumulated_pred = np.sum(predictions, axis=0)
425
- predicted_class = np.argmax(np.sum(accumulated_pred, axis=0))
426
- #print(labels[predicted_class])
427
 
428
  return labels[predicted_class]
429
  input_text = gr.inputs.Textbox(label="Enter a sentence")
 
420
  input_a = np.asarray([window_input])
421
  pred = Modell.predict(input_a, batch_size=None, verbose=0, steps=None)
422
  #print(pred)
423
+ predicted_class = np.argmax(pred)
424
+ predictions.append(predicted_class)
425
+ #predicted_class = Counter(predictions).most_common(1)[0][0]
 
426
 
427
  return labels[predicted_class]
428
  input_text = gr.inputs.Textbox(label="Enter a sentence")