ThorbenFroehlking commited on
Commit
502fc3c
·
1 Parent(s): c8b39c2
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +0 -8
  2. app.py +0 -8
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -629,7 +629,6 @@ with gr.Blocks(css="""
629
  with torch.no_grad():
630
  outputs = model(input_ids).logits.detach().cpu().numpy().squeeze()
631
 
632
- # Calculate scores and normalize them
633
  raw_scores = expit(outputs[:, 1] - outputs[:, 0])
634
  normalized_scores = normalize_scores(raw_scores)
635
 
@@ -638,15 +637,9 @@ with gr.Blocks(css="""
638
  "normalized_scores": normalized_scores.tolist()
639
  }
640
 
641
- #gr.Interface(
642
- # fn=predict_utils,
643
- # inputs=gr.Textbox(visible=False),
644
- # outputs=gr.Textbox(visible=False)
645
- #)
646
  dummy_input = gr.Textbox(visible=False)
647
  dummy_output = gr.Textbox(visible=False)
648
 
649
- # Create a dummy button that's invisible
650
  dummy_btn = gr.Button("Predict Sequence", visible=False)
651
  dummy_btn.click(
652
  predict_utils,
@@ -654,5 +647,4 @@ with gr.Blocks(css="""
654
  outputs=[dummy_output]
655
  )
656
 
657
-
658
  demo.launch(share=True)
 
629
  with torch.no_grad():
630
  outputs = model(input_ids).logits.detach().cpu().numpy().squeeze()
631
 
 
632
  raw_scores = expit(outputs[:, 1] - outputs[:, 0])
633
  normalized_scores = normalize_scores(raw_scores)
634
 
 
637
  "normalized_scores": normalized_scores.tolist()
638
  }
639
 
 
 
 
 
 
640
  dummy_input = gr.Textbox(visible=False)
641
  dummy_output = gr.Textbox(visible=False)
642
 
 
643
  dummy_btn = gr.Button("Predict Sequence", visible=False)
644
  dummy_btn.click(
645
  predict_utils,
 
647
  outputs=[dummy_output]
648
  )
649
 
 
650
  demo.launch(share=True)
app.py CHANGED
@@ -629,7 +629,6 @@ with gr.Blocks(css="""
629
  with torch.no_grad():
630
  outputs = model(input_ids).logits.detach().cpu().numpy().squeeze()
631
 
632
- # Calculate scores and normalize them
633
  raw_scores = expit(outputs[:, 1] - outputs[:, 0])
634
  normalized_scores = normalize_scores(raw_scores)
635
 
@@ -638,15 +637,9 @@ with gr.Blocks(css="""
638
  "normalized_scores": normalized_scores.tolist()
639
  }
640
 
641
- #gr.Interface(
642
- # fn=predict_utils,
643
- # inputs=gr.Textbox(visible=False),
644
- # outputs=gr.Textbox(visible=False)
645
- #)
646
  dummy_input = gr.Textbox(visible=False)
647
  dummy_output = gr.Textbox(visible=False)
648
 
649
- # Create a dummy button that's invisible
650
  dummy_btn = gr.Button("Predict Sequence", visible=False)
651
  dummy_btn.click(
652
  predict_utils,
@@ -654,5 +647,4 @@ with gr.Blocks(css="""
654
  outputs=[dummy_output]
655
  )
656
 
657
-
658
  demo.launch(share=True)
 
629
  with torch.no_grad():
630
  outputs = model(input_ids).logits.detach().cpu().numpy().squeeze()
631
 
 
632
  raw_scores = expit(outputs[:, 1] - outputs[:, 0])
633
  normalized_scores = normalize_scores(raw_scores)
634
 
 
637
  "normalized_scores": normalized_scores.tolist()
638
  }
639
 
 
 
 
 
 
640
  dummy_input = gr.Textbox(visible=False)
641
  dummy_output = gr.Textbox(visible=False)
642
 
 
643
  dummy_btn = gr.Button("Predict Sequence", visible=False)
644
  dummy_btn.click(
645
  predict_utils,
 
647
  outputs=[dummy_output]
648
  )
649
 
 
650
  demo.launch(share=True)