Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
from transformers import pipeline, RobertaForSequenceClassification, RobertaTokenizer
|
@@ -526,7 +527,9 @@ def analyze_single_message(text, thresholds):
|
|
526 |
print("------------------\n")
|
527 |
|
528 |
return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score, tone_tag
|
|
|
529 |
|
|
|
530 |
def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
531 |
from collections import Counter
|
532 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
import torch
|
4 |
import numpy as np
|
5 |
from transformers import pipeline, RobertaForSequenceClassification, RobertaTokenizer
|
|
|
527 |
print("------------------\n")
|
528 |
|
529 |
return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score, tone_tag
|
530 |
+
import spaces
|
531 |
|
532 |
+
@spaces.GPU
|
533 |
def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
534 |
from collections import Counter
|
535 |
|