Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
16 |
classifier = pipeline("text-classification", tokenizer=tokenizer, model=model, max_length=512,
|
17 |
padding=True, truncation=True, batch_size=1)
|
18 |
|
19 |
-
def prozesatu(
|
20 |
-
prediction = prozesatu.classifier(
|
21 |
if prediction["label"]=="GAI":
|
22 |
return {"Gai":prediction["score"], "Ez gai": 1-prediction["score"]}
|
23 |
else:
|
@@ -29,8 +29,8 @@ prozesatu.classifier = classifier
|
|
29 |
demo = gr.Interface(
|
30 |
fn=prozesatu,
|
31 |
inputs=gr.Textbox(placeholder="Idatzi hemen testua..."),
|
32 |
-
outputs="
|
33 |
interpretation="default",
|
34 |
-
examples=[["Gaur egungo teknologiak bikainak dira..."]]).launch()
|
35 |
|
36 |
#gr.Interface(fn=prozesatu, inputs="text", outputs="text").launch()
|
|
|
16 |
classifier = pipeline("text-classification", tokenizer=tokenizer, model=model, max_length=512,
|
17 |
padding=True, truncation=True, batch_size=1)
|
18 |
|
19 |
+
def prozesatu(Testua):
|
20 |
+
prediction = prozesatu.classifier(Testua)[0]
|
21 |
if prediction["label"]=="GAI":
|
22 |
return {"Gai":prediction["score"], "Ez gai": 1-prediction["score"]}
|
23 |
else:
|
|
|
29 |
demo = gr.Interface(
|
30 |
fn=prozesatu,
|
31 |
inputs=gr.Textbox(placeholder="Idatzi hemen testua..."),
|
32 |
+
outputs="C1",
|
33 |
interpretation="default",
|
34 |
+
examples=[["Gaur egungo teknologiak bikainak dira..."]]).launch(share=True)
|
35 |
|
36 |
#gr.Interface(fn=prozesatu, inputs="text", outputs="text").launch()
|