Spaces:
Running
Running
HEADER_MD = """# ๐ฌ BaseChat: Chat with Base LLMs via URIAL | |
[๐ Paper](https://arxiv.org/abs/2312.01552) | [๐ Website](https://allenai.github.io/re-align/) | [๐ป GitHub](https://github.com/Re-Align/urial) | [๐ฆ X-1](https://x.com/billyuchenlin/status/1799885923045568531) [๐ฆ X-2](https://x.com/billyuchenlin/status/1759541978881311125) | ๐ฎ Contact: [Yuchen Lin](https://yuchenlin.xyz/) | |
**Talk with __BASE__ LLMs which are not fine-tuned at all. The used URIAL prompt is [here](https://github.com/Re-Align/URIAL/blob/main/urial_prompts/inst_1k_v4.help.txt.md).** | |
- We now also show the responses of the associated aligned model for comparisons. | |
""" | |
js_code_label = """ | |
function addApiKeyLink() { | |
// Select the div with id 'api_key' | |
const apiKeyDiv = document.getElementById('api_key'); | |
// Find the span within that div with data-testid 'block-info' | |
const blockInfoSpan = apiKeyDiv.querySelector('span[data-testid="block-info"]'); | |
// Create the new link element | |
const newLink = document.createElement('a'); | |
newLink.href = 'https://api.together.ai/settings/api-keys'; | |
newLink.textContent = ' View your keys here.'; | |
newLink.target = '_blank'; // Open link in new tab | |
newLink.style = 'color: #007bff; text-decoration: underline;'; | |
// Create the additional text | |
const additionalText = document.createTextNode(' (new account will have free credits to use.)'); | |
// Append the link and additional text to the span | |
if (blockInfoSpan) { | |
// add a br | |
apiKeyDiv.appendChild(document.createElement('br')); | |
apiKeyDiv.appendChild(newLink); | |
apiKeyDiv.appendChild(additionalText); | |
} else { | |
console.error('Span with data-testid "block-info" not found'); | |
} | |
} | |
""" | |
MODELS = ["Llama-3.1-405B-FP8", "Llama-3-70B", "Llama-3-8B", | |
"Mistral-7B-v0.1", | |
"Mixtral-8x22B", "Qwen1.5-72B", "Yi-34B", "Llama-2-7B", "Llama-2-70B", "OLMo-7B"] | |
HYPERBOLIC_MODELS = ["meta-llama/Meta-Llama-3.1-405B-FP8", "meta-llama/Meta-Llama-3.1-405B-Instruct"] | |
BASE_TO_ALIGNED = { | |
"Llama-3-70B": "Llama-3-70B-Instruct", | |
"Llama-3-8B": "Llama-3-8B-Instruct", | |
"Mistral-7B-v0.1": "Mistral-7B-v0.1-Instruct", | |
"Mixtral-8x22B": "Mixtral-8x22B-Instruct", | |
"Qwen1.5-72B": "Qwen1.5-72B-Instruct", | |
"Llama-3.1-405B-FP8": "Llama-3.1-405B-Instruct-BF16", | |
"Yi-34B": "Yi-34B-chat", | |
"Llama-2-7B": "Llama-2-7B-chat", | |
"Llama-2-70B": "Llama-2-70B-chat", | |
"OLMo-7B": "OLMo-7B-Instruct", | |
} | |
MODEL_MAPPING = { | |
"Llama-3-8B": "meta-llama/Llama-3-8b-hf", | |
"Llama-3-70B": "meta-llama/Llama-3-70b-hf", | |
"Llama-2-7B": "meta-llama/Llama-2-7b-hf", | |
"Llama-2-70B": "meta-llama/Llama-2-70b-hf", | |
"Mistral-7B-v0.1": "mistralai/Mistral-7B-v0.1", | |
"Mixtral-8x22B": "mistralai/Mixtral-8x22B", | |
"Qwen1.5-72B": "Qwen/Qwen1.5-72B", | |
"Yi-34B": "zero-one-ai/Yi-34B", | |
"Yi-6B": "zero-one-ai/Yi-6B", | |
"OLMo-7B": "allenai/OLMo-7B", | |
"Llama-3.1-405B-FP8": "meta-llama/Meta-Llama-3.1-405B-FP8", | |
# Aligned models below | |
"Llama-3-70B-Instruct": "meta-llama/Meta-Llama-3-70B-Instruct-Lite", | |
"Llama-3-8B-Instruct": "meta-llama/Meta-Llama-3-8B-Instruct-Lite", | |
"Mistral-7B-v0.1-Instruct": "mistralai/Mistral-7B-Instruct-v0.1", | |
"Mixtral-8x22B-Instruct": "mistralai/Mixtral-8x22B-Instruct-v0.1", | |
"Qwen1.5-72B-Instruct": "Qwen/Qwen2-72B-Instruct", | |
"Yi-34B-chat": "zero-one-ai/Yi-34B-Chat", | |
"Llama-2-7B-chat": "meta-llama/Llama-2-7b-chat-hf", | |
"Llama-2-70B-chat": "meta-llama/Llama-2-70b-chat-hf", | |
"OLMo-7B-Instruct": "allenai/OLMo-7B-Instruct", | |
"Llama-3.1-405B-Instruct-BF16": "meta-llama/Meta-Llama-3.1-405B-Instruct", | |
} | |
my_css = """ | |
/* CSS for a link color that is visible on both black and white backgrounds */ | |
a { | |
color: #1E90FF; /* DodgerBlue */ | |
text-decoration: none; /* Optional: remove underline */ | |
} | |
a:hover { | |
color: #104E8B; /* Slightly darker blue for hover effect */ | |
text-decoration: underline; /* Optional: add underline on hover */ | |
} | |
""" | |
# import json | |
# with open("together_model_ids.json", "r") as f: | |
# TOGETHER_MODEL_IDS = json.load(f) | |
# for _, model_id in MODEL_MAPPING.items(): | |
# if model_id not in TOGETHER_MODEL_IDS + HYPERBOLIC_MODELS: | |
# print(model_id) |