Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,10 +33,10 @@ def interpret_pred_with_sensibility(pred):
|
|
33 |
return proba
|
34 |
|
35 |
|
36 |
-
def main(
|
37 |
|
38 |
input_ids = torch.tensor(
|
39 |
-
[barthez_tokenizer.encode(
|
40 |
)
|
41 |
|
42 |
predict = model.forward(input_ids)[0]
|
@@ -47,11 +47,11 @@ def main(text_sentence):
|
|
47 |
#)
|
48 |
|
49 |
proba = interpret_pred_with_sensibility(predict)
|
50 |
-
|
51 |
"La probabilité que ce texte a été généré par de l'IA est {}"
|
52 |
.format(proba)
|
53 |
)
|
54 |
-
return
|
55 |
|
56 |
|
57 |
iface = gr.Interface(fn=main, inputs="text", outputs="text")
|
|
|
33 |
return proba
|
34 |
|
35 |
|
36 |
+
def main(Texte -> Resultat):
|
37 |
|
38 |
input_ids = torch.tensor(
|
39 |
+
[barthez_tokenizer.encode(Texte, truncation=True, padding=True, add_special_tokens=True)]
|
40 |
)
|
41 |
|
42 |
predict = model.forward(input_ids)[0]
|
|
|
47 |
#)
|
48 |
|
49 |
proba = interpret_pred_with_sensibility(predict)
|
50 |
+
Resultat = (
|
51 |
"La probabilité que ce texte a été généré par de l'IA est {}"
|
52 |
.format(proba)
|
53 |
)
|
54 |
+
return Resultat
|
55 |
|
56 |
|
57 |
iface = gr.Interface(fn=main, inputs="text", outputs="text")
|