Skip to content

Commit

Permalink
Enable displaying only model outputs with no source (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasnerz authored Dec 2, 2024
1 parent df648d9 commit 2f2bcd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
13 changes: 12 additions & 1 deletion factgenie/static/js/browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,18 @@ function fetchExample(dataset, split, example_idx) {
return;
}
$("#dataset-spinner").hide();
$("#examplearea").html(data.html);

if (data.html === null) {
$("#centerpanel").hide();
// disable Split.js
splitInstance.setSizes([0, 100]);
// center the right panel
$("#rightpanel").css("width", "50%");
$("#rightpanel").css("margin", "auto");

} else {
$("#examplearea").html(data.html);
}

showRawData(data);

Expand Down
9 changes: 5 additions & 4 deletions factgenie/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ def get_example_data(app, dataset_id, split, example_idx, setup_id=None):

try:
html = dataset.render(example=example)

if html is not None:
# temporary solution for external files
# prefix all the "/files" calls with "app.config["host_prefix"]"
html = html.replace('src="/files', f'src="{app.config["host_prefix"]}/files')
except:
raise ValueError("Example cannot be rendered")

# temporary solution for external files
# prefix all the "/files" calls with "app.config["host_prefix"]"
html = html.replace('src="/files', f'src="{app.config["host_prefix"]}/files')

if setup_id:
generated_outputs = [
get_output_for_setup(dataset_id, split, example_idx, setup_id, app=app, force_reload=False)
Expand Down

0 comments on commit 2f2bcd5

Please sign in to comment.