Spaces:
Running
Running
css and default model names
Browse files- app.py +5 -3
- constant.py +16 -2
app.py
CHANGED
@@ -4,7 +4,7 @@ from typing import List
|
|
4 |
import logging
|
5 |
import urllib.request
|
6 |
from utils import model_name_mapping, urial_template, openai_base_request, chat_template, openai_chat_request
|
7 |
-
from constant import js_code_label, HEADER_MD, BASE_TO_ALIGNED, MODELS
|
8 |
from openai import OpenAI
|
9 |
import datetime
|
10 |
# add logging info to console
|
@@ -141,7 +141,7 @@ def clear_fn():
|
|
141 |
return None, None, None
|
142 |
|
143 |
|
144 |
-
with gr.Blocks(gr.themes.Soft(), js=js_code_label) as demo:
|
145 |
api_key = gr.Textbox(label="π APIKey", placeholder="Enter your Together/Hyperbolic API Key. Leave it blank to use our key with limited usage.", type="password", elem_id="api_key", visible=False)
|
146 |
|
147 |
gr.Markdown(HEADER_MD)
|
@@ -182,7 +182,9 @@ with gr.Blocks(gr.themes.Soft(), js=js_code_label) as demo:
|
|
182 |
with gr.Row():
|
183 |
top_p_2 = gr.Slider(label="Top-P", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
184 |
rp_2 = gr.Slider(label="Repetition Penalty", step=0.1, minimum=0.1, maximum=2.0, value=1.0)
|
185 |
-
|
|
|
|
|
186 |
left_model_choice.change(load_models, [left_model_choice], [chat_a, chat_b, right_model_choice])
|
187 |
|
188 |
model_type_left = gr.Textbox(visible=False, value="base")
|
|
|
4 |
import logging
|
5 |
import urllib.request
|
6 |
from utils import model_name_mapping, urial_template, openai_base_request, chat_template, openai_chat_request
|
7 |
+
from constant import js_code_label, my_css, HEADER_MD, BASE_TO_ALIGNED, MODELS
|
8 |
from openai import OpenAI
|
9 |
import datetime
|
10 |
# add logging info to console
|
|
|
141 |
return None, None, None
|
142 |
|
143 |
|
144 |
+
with gr.Blocks(gr.themes.Soft(), js=js_code_label, css=my_css) as demo:
|
145 |
api_key = gr.Textbox(label="π APIKey", placeholder="Enter your Together/Hyperbolic API Key. Leave it blank to use our key with limited usage.", type="password", elem_id="api_key", visible=False)
|
146 |
|
147 |
gr.Markdown(HEADER_MD)
|
|
|
182 |
with gr.Row():
|
183 |
top_p_2 = gr.Slider(label="Top-P", step=0.01, minimum=0.01, maximum=1.0, value=0.9)
|
184 |
rp_2 = gr.Slider(label="Repetition Penalty", step=0.1, minimum=0.1, maximum=2.0, value=1.0)
|
185 |
+
|
186 |
+
left_model_choice.value = "Llama-3.1-405B-FP8"
|
187 |
+
right_model_choice.value = "Llama-3.1-405B-Instruct-FP16"
|
188 |
left_model_choice.change(load_models, [left_model_choice], [chat_a, chat_b, right_model_choice])
|
189 |
|
190 |
model_type_left = gr.Textbox(visible=False, value="base")
|
constant.py
CHANGED
@@ -49,7 +49,7 @@ BASE_TO_ALIGNED = {
|
|
49 |
"Mistral-7B-v0.1": "Mistral-7B-v0.1-Instruct",
|
50 |
"Mixtral-8x22B": "Mixtral-8x22B-Instruct",
|
51 |
"Qwen1.5-72B": "Qwen1.5-72B-Instruct",
|
52 |
-
"Llama-3.1-405B-FP8": "Llama-3.1-405B-
|
53 |
"Yi-34B": "Yi-34B-chat",
|
54 |
"Llama-2-7B": "Llama-2-7B-chat",
|
55 |
"Llama-2-70B": "Llama-2-70B-chat",
|
@@ -79,9 +79,23 @@ MODEL_MAPPING = {
|
|
79 |
"Llama-2-7B-chat": "meta-llama/Llama-2-7b-chat-hf",
|
80 |
"Llama-2-70B-chat": "meta-llama/Llama-2-70b-chat-hf",
|
81 |
"OLMo-7B-Instruct": "allenai/OLMo-7B-Instruct",
|
82 |
-
"Llama-3.1-405B-
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
# import json
|
86 |
# with open("together_model_ids.json", "r") as f:
|
87 |
# TOGETHER_MODEL_IDS = json.load(f)
|
|
|
49 |
"Mistral-7B-v0.1": "Mistral-7B-v0.1-Instruct",
|
50 |
"Mixtral-8x22B": "Mixtral-8x22B-Instruct",
|
51 |
"Qwen1.5-72B": "Qwen1.5-72B-Instruct",
|
52 |
+
"Llama-3.1-405B-FP8": "Llama-3.1-405B-Instruct-FP16",
|
53 |
"Yi-34B": "Yi-34B-chat",
|
54 |
"Llama-2-7B": "Llama-2-7B-chat",
|
55 |
"Llama-2-70B": "Llama-2-70B-chat",
|
|
|
79 |
"Llama-2-7B-chat": "meta-llama/Llama-2-7b-chat-hf",
|
80 |
"Llama-2-70B-chat": "meta-llama/Llama-2-70b-chat-hf",
|
81 |
"OLMo-7B-Instruct": "allenai/OLMo-7B-Instruct",
|
82 |
+
"Llama-3.1-405B-Instruct-FP16": "meta-llama/Meta-Llama-3.1-405B-Instruct",
|
83 |
}
|
84 |
|
85 |
+
|
86 |
+
my_css = """
|
87 |
+
/* CSS for a link color that is visible on both black and white backgrounds */
|
88 |
+
a {
|
89 |
+
color: #1E90FF; /* DodgerBlue */
|
90 |
+
text-decoration: none; /* Optional: remove underline */
|
91 |
+
}
|
92 |
+
|
93 |
+
a:hover {
|
94 |
+
color: #104E8B; /* Slightly darker blue for hover effect */
|
95 |
+
text-decoration: underline; /* Optional: add underline on hover */
|
96 |
+
}
|
97 |
+
|
98 |
+
"""
|
99 |
# import json
|
100 |
# with open("together_model_ids.json", "r") as f:
|
101 |
# TOGETHER_MODEL_IDS = json.load(f)
|