import json with open("model_info.json", "r") as f: model_info = json.load(f) def make_clickable_model(model_name): global model_info modified_model_name = model_name if model_name in model_info: is_open_model = not model_info[model_name]["hf_model_id"].startswith("http") is_open_model = model_info[model_name].get("open", is_open_model) if not is_open_model: link = model_info[model_name]["hf_model_id"] modified_model_name = f'🔒 {model_info[model_name]["pretty_name"]}' else: link = f"https://huggingface.co/{model_info[model_name]['hf_model_id']}" modified_model_name = f'🔑 {model_info[model_name]["pretty_name"]}' if "Neo-7B" in modified_model_name: # models that are fully open source modified_model_name = modified_model_name.replace("🔑", "💎🔑") hidden = model_info[model_name].get("hidden", False) if hidden: modified_model_name = f'❌ {modified_model_name}' if "🚨" in modified_model_name: modified_model_name = modified_model_name.replace(' 🚨', ' 🚨') # if model_name in ["gpt-4-turbo-2024-04-09", "Llama-2-70b-chat-hf", "claude-3-haiku-20240307"]: # modified_model_name = modified_model_name.replace('style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;"', 'style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted; font-weight: bold; background-color: var(--link-background-color);"') return modified_model_name def styled_error(error): return f"

{error}

" def styled_warning(warn): return f"

{warn}

" def styled_message(message): return f"

{message}

"