Hi there,
I am trying to show a dynamic html page. When opening the web app on a browser, I am getting the following message:
✘ Invalid task format for view ID 'html'
html field required
{'Unnamed: 0': 49373, 'title': 'My Song', 'name': 'John', 'match': -1, '_input_hash': 1434188556, '_task_hash': 836244794, '_session_id': None, '_view_id': 'html'}
Any idea? Here is my recipe.py file:
import prodigy
from prodigy.components.loaders import JSONL
import pandas as pd
@prodigy.recipe('custom-recipe')
def custom_recipe(dataset, source):
def stream():
df = pd.read_csv(source, sep='\t')
for index, row in df.iterrows():
yield dict(row)
def html_template():
return '''<table border="1">
<tr>
<th>Info</th>
</tr>
<tr>
<td>{{ title }}</td>
</tr>
<tr>
<td>{{ name }}</td>
</tr></table>'''
return {
'view_id': 'html',
'dataset': dataset,
'stream': stream(),
'config': {
'html_template': html_template(),
'custom_theme':{'cardMaxWidth': 1675}
}
}