Spaces:
Build error
Build error
Update PanelInterface.py
Browse files- PanelInterface.py +9 -3
PanelInterface.py
CHANGED
|
@@ -2,6 +2,8 @@ import gradio as gr
|
|
| 2 |
import pandas as pd
|
| 3 |
import logging
|
| 4 |
import json
|
|
|
|
|
|
|
| 5 |
|
| 6 |
from InteractiveInterviewChatbot import *
|
| 7 |
|
|
@@ -9,12 +11,16 @@ from InteractiveInterviewChatbot import *
|
|
| 9 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 10 |
|
| 11 |
|
| 12 |
-
def load_panelists_from_excel(file_path=
|
|
|
|
|
|
|
| 13 |
df = pd.read_excel(file_path, sheet_name="panelist_details")
|
| 14 |
return df.to_dict(orient="records")
|
| 15 |
|
| 16 |
|
| 17 |
-
def load_ui_texts_from_excel(file_path=
|
|
|
|
|
|
|
| 18 |
df = pd.read_excel(file_path, sheet_name="ui_texts")
|
| 19 |
return dict(zip(df['key'], df['value']))
|
| 20 |
|
|
@@ -60,7 +66,7 @@ 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(
|
| 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>"
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import logging
|
| 4 |
import json
|
| 5 |
+
import os
|
| 6 |
+
from config import Config
|
| 7 |
|
| 8 |
from InteractiveInterviewChatbot import *
|
| 9 |
|
|
|
|
| 11 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 12 |
|
| 13 |
|
| 14 |
+
def load_panelists_from_excel(file_path=None):
|
| 15 |
+
if file_path is None:
|
| 16 |
+
file_path = Config.hugging_face_excel_file
|
| 17 |
df = pd.read_excel(file_path, sheet_name="panelist_details")
|
| 18 |
return df.to_dict(orient="records")
|
| 19 |
|
| 20 |
|
| 21 |
+
def load_ui_texts_from_excel(file_path=None):
|
| 22 |
+
if file_path is None:
|
| 23 |
+
file_path = Config.hugging_face_excel_file
|
| 24 |
df = pd.read_excel(file_path, sheet_name="ui_texts")
|
| 25 |
return dict(zip(df['key'], df['value']))
|
| 26 |
|
|
|
|
| 66 |
logging.info("Building Gradio interface...")
|
| 67 |
|
| 68 |
# Load panelists from Excel
|
| 69 |
+
panelists = load_panelists_from_excel()
|
| 70 |
bios_js_object = {p["ID"]: f"<b>{p['Name']}</b><br>{p['Description']}<br><br>{p['Bio']}" for p in panelists}
|
| 71 |
panel_html = "".join(
|
| 72 |
f"<p><a href='javascript:void(0);' onclick='showModal(event, \"{p['ID']}\"); return false;'><b>{p['Name']}</b></a> – {p['Description']}</p>"
|