Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import json
|
3 |
-
from
|
4 |
-
from sentence_transformers import SentenceTransformer, InputExample, losses, util, evaluation
|
5 |
import pandas as pd
|
6 |
|
7 |
def Main(Modelo, Texto1, Texto2):
|
@@ -19,25 +18,6 @@ def Main(Modelo, Texto1, Texto2):
|
|
19 |
|
20 |
return [error, modelResult]
|
21 |
|
22 |
-
def ConvertJsonToList(fileName):
|
23 |
-
subject_fileDataset = load_dataset("json", data_files=fileName)
|
24 |
-
|
25 |
-
samples = []
|
26 |
-
|
27 |
-
for i in range (0,len(subject_fileDataset["train"])): #len(subject1)
|
28 |
-
hashed_id = subject_fileDataset["train"][i]['hashed_id']
|
29 |
-
mark = subject_fileDataset["train"][i]['nota']
|
30 |
-
responseStudent = subject_fileDataset["train"][i]['respuesta']
|
31 |
-
responseTeacher = ""
|
32 |
-
for j in range(0,len(subject_fileDataset["train"][i]['metadata']['minipreguntas'])):
|
33 |
-
responseTeacher = responseTeacher + subject_fileDataset["train"][i]['metadata']['minipreguntas'][j]['minirespuesta']
|
34 |
-
|
35 |
-
ie = InputExample(guid= hashed_id, texts=[responseTeacher, responseStudent], label=mark)
|
36 |
-
|
37 |
-
samples.append(ie)
|
38 |
-
|
39 |
-
return samples
|
40 |
-
|
41 |
def TestModel(checkpoint, data):
|
42 |
local_model_path = checkpoint
|
43 |
model = SentenceTransformer(local_model_path)
|
|
|
1 |
import gradio as gr
|
2 |
import json
|
3 |
+
from sentence_transformers import SentenceTransformer, InputExample, util
|
|
|
4 |
import pandas as pd
|
5 |
|
6 |
def Main(Modelo, Texto1, Texto2):
|
|
|
18 |
|
19 |
return [error, modelResult]
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
def TestModel(checkpoint, data):
|
22 |
local_model_path = checkpoint
|
23 |
model = SentenceTransformer(local_model_path)
|