Spaces:
Running
on
Zero
Running
on
Zero
update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,10 @@ def evaluate_model(model_id):
|
|
64 |
# Rename columns
|
65 |
dataset = dataset.rename_column(dataset_info["columns"][0], "anchor")
|
66 |
dataset = dataset.rename_column(dataset_info["columns"][1], "positive")
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
# Prepare queries and corpus
|
70 |
corpus = dict(zip(dataset["id"], dataset["positive"]))
|
@@ -123,4 +126,4 @@ demo = gr.Interface(
|
|
123 |
|
124 |
# Launch the Gradio app
|
125 |
if __name__ == "__main__":
|
126 |
-
demo.launch(
|
|
|
64 |
# Rename columns
|
65 |
dataset = dataset.rename_column(dataset_info["columns"][0], "anchor")
|
66 |
dataset = dataset.rename_column(dataset_info["columns"][1], "positive")
|
67 |
+
|
68 |
+
# Check if "id" column already exists before adding it
|
69 |
+
if "id" not in dataset.column_names:
|
70 |
+
dataset = dataset.add_column("id", range(len(dataset)))
|
71 |
|
72 |
# Prepare queries and corpus
|
73 |
corpus = dict(zip(dataset["id"], dataset["positive"]))
|
|
|
126 |
|
127 |
# Launch the Gradio app
|
128 |
if __name__ == "__main__":
|
129 |
+
demo.launch()
|