Spaces:
Build error
Build error
Update PanelInterface.py
Browse files- PanelInterface.py +6 -6
PanelInterface.py
CHANGED
|
@@ -10,12 +10,12 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
|
|
| 10 |
|
| 11 |
|
| 12 |
def load_panelists_from_excel(file_path="config/genzheroes/hugging_face_details.xlsx"):
|
| 13 |
-
df = pd.read_excel(file_path)
|
| 14 |
return df.to_dict(orient="records")
|
| 15 |
|
| 16 |
|
| 17 |
-
def load_ui_texts_from_excel(file_path="config/genzheroes/
|
| 18 |
-
df = pd.read_excel(file_path)
|
| 19 |
return dict(zip(df['key'], df['value']))
|
| 20 |
|
| 21 |
|
|
@@ -60,15 +60,15 @@ def build_interface(respondent_agents_dict, processor_llm):
|
|
| 60 |
logging.info("Building Gradio interface...")
|
| 61 |
|
| 62 |
# Load panelists from Excel
|
| 63 |
-
panelists = load_panelists_from_excel("config/genzheroes/hugging_face_details.xlsx")
|
| 64 |
bios_js_object = {p["ID"]: f"<b>{p['Name']}</b><br>{p['Description']}<br><br>{p['Bio']}" for p in panelists}
|
| 65 |
panel_html = "".join(
|
| 66 |
f"<p><a href='javascript:void(0);' onclick='showModal(event, \"{p['ID']}\"); return false;'><b>{p['Name']}</b></a> – {p['Description']}</p>"
|
| 67 |
for p in panelists
|
| 68 |
-
|
| 69 |
|
| 70 |
# Load UI texts from Excel
|
| 71 |
-
ui_texts = load_ui_texts_from_excel("config/genzheroes/
|
| 72 |
|
| 73 |
with gr.Blocks(css="assets/custom.css") as demo:
|
| 74 |
with gr.Row(elem_classes="logo-row"):
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def load_panelists_from_excel(file_path="config/genzheroes/hugging_face_details.xlsx"):
|
| 13 |
+
df = pd.read_excel(file_path, sheet_name="panelist_detaiks")
|
| 14 |
return df.to_dict(orient="records")
|
| 15 |
|
| 16 |
|
| 17 |
+
def load_ui_texts_from_excel(file_path="config/genzheroes/hugging_face_details.xlsx"):
|
| 18 |
+
df = pd.read_excel(file_path, sheet_name="ui_texts")
|
| 19 |
return dict(zip(df['key'], df['value']))
|
| 20 |
|
| 21 |
|
|
|
|
| 60 |
logging.info("Building Gradio interface...")
|
| 61 |
|
| 62 |
# Load panelists from Excel
|
| 63 |
+
panelists = load_panelists_from_excel("config/genzheroes/hugging_face_details.xlsx", sheet_name="panelist_detaiks")
|
| 64 |
bios_js_object = {p["ID"]: f"<b>{p['Name']}</b><br>{p['Description']}<br><br>{p['Bio']}" for p in panelists}
|
| 65 |
panel_html = "".join(
|
| 66 |
f"<p><a href='javascript:void(0);' onclick='showModal(event, \"{p['ID']}\"); return false;'><b>{p['Name']}</b></a> – {p['Description']}</p>"
|
| 67 |
for p in panelists
|
| 68 |
+
)
|
| 69 |
|
| 70 |
# Load UI texts from Excel
|
| 71 |
+
ui_texts = load_ui_texts_from_excel("config/genzheroes/hugging_face_details.xlsx", sheet_name="ui_texts")
|
| 72 |
|
| 73 |
with gr.Blocks(css="assets/custom.css") as demo:
|
| 74 |
with gr.Row(elem_classes="logo-row"):
|