Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,15 +5,7 @@ from fastai.text.all import *
|
|
| 5 |
repo_id = "GabrielMI/entregable3"
|
| 6 |
|
| 7 |
learner = from_pretrained_fastai(repo_id)
|
| 8 |
-
labels = [
|
| 9 |
-
|
| 10 |
-
def translate_label(label):
|
| 11 |
-
label_dict = {
|
| 12 |
-
0: "Entailment",
|
| 13 |
-
1: "Neutral",
|
| 14 |
-
2: "Contradiction"
|
| 15 |
-
}
|
| 16 |
-
return label_dict[label]
|
| 17 |
|
| 18 |
def predict(text1, text2):
|
| 19 |
combined_text = text1 + " [SEP] " + text2
|
|
@@ -22,6 +14,6 @@ def predict(text1, text2):
|
|
| 22 |
|
| 23 |
gr.Interface(
|
| 24 |
fn=predict,
|
| 25 |
-
inputs=[gr.Textbox(label="
|
| 26 |
outputs=gr.Label(num_top_classes=3),
|
| 27 |
).launch(share=False)
|
|
|
|
| 5 |
repo_id = "GabrielMI/entregable3"
|
| 6 |
|
| 7 |
learner = from_pretrained_fastai(repo_id)
|
| 8 |
+
labels = ["Python", "Java", "C++", "Fortran", "Go"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def predict(text1, text2):
|
| 11 |
combined_text = text1 + " [SEP] " + text2
|
|
|
|
| 14 |
|
| 15 |
gr.Interface(
|
| 16 |
fn=predict,
|
| 17 |
+
inputs=[gr.Textbox(label="Instrucciones")],
|
| 18 |
outputs=gr.Label(num_top_classes=3),
|
| 19 |
).launch(share=False)
|