VAPO_data_demo / utils_display.py
DaYin's picture
Upload 69 files
e90fa51 verified
import json
with open("model_info.json", "r") as f:
model_info = json.load(f)
def make_clickable_model(model_name):
global model_info
if model_name in model_info:
if model_info[model_name]["hf_model_id"].startswith("http"):
link = model_info[model_name]["hf_model_id"]
return f'🔒 <a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_info[model_name]["pretty_name"]}</a>'
else:
link = f"https://huggingface.co/{model_info[model_name]['hf_model_id']}"
return f'🔥 <a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_info[model_name]["pretty_name"]}</a>'
else:
return model_name
def styled_error(error):
return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
def styled_warning(warn):
return f"<p style='color: orange; font-size: 20px; text-align: center;'>{warn}</p>"
def styled_message(message):
return f"<p style='color: green; font-size: 20px; text-align: center;'>{message}</p>"