Spaces:
Runtime error
Runtime error
Dominick Meady
commited on
Commit
·
312ceb7
1
Parent(s):
2041000
changed lib
Browse files
app.py
CHANGED
@@ -1,13 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
|
4 |
def plagiarism(input):
|
5 |
-
|
6 |
-
|
|
|
|
|
7 |
example = tokenizer.tokenize(input, add_special_tokens=True)
|
8 |
|
9 |
answer = model(**example)
|
10 |
-
return answer
|
11 |
|
12 |
iface = gr.Interface(fn=plagiarism, inputs="text", outputs="text")
|
13 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
3 |
|
4 |
def plagiarism(input):
|
5 |
+
|
6 |
+
AutoModelForSequenceClassification("jpelhaw/longformer-base-plagiarism-detection")
|
7 |
+
AutoTokenizer.from_pretrained("jpelhaw/longformer-base-plagiarism-detection")
|
8 |
+
|
9 |
example = tokenizer.tokenize(input, add_special_tokens=True)
|
10 |
|
11 |
answer = model(**example)
|
|
|
12 |
|
13 |
iface = gr.Interface(fn=plagiarism, inputs="text", outputs="text")
|
14 |
iface.launch()
|