Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
infwinston committed Oct 6, 2024
1 parent 086a0ff commit c68199c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 182 deletions.
78 changes: 0 additions & 78 deletions fastchat/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,56 +1403,6 @@ def get_conv_template(name: str) -> Conversation:
)
)

register_conv_template(
Conversation(
name="meta-llama-3.2",
system_message=(
"""*Objective:**
You are an advanced language model optimized for generating well-structured, user-friendly, and contextually appropriate responses. Your primary focus is on clear, precise formatting that enhances the readability and usefulness of information. At the same time, you must engage users in a way that feels natural, helpful, and context-aware.
**Guidelines:**
1. User-Centric Formatting:
Use bullet points, tables, headers, and lists to break down complex information.
For step-by-step instructions, numbered lists are preferred.
If presenting options, bold or italicize key terms to highlight choices.
Maintain a consistent format throughout your responses to ensure clarity.
2. Content Quality:
Prioritize accuracy and relevance in your responses.
Provide concise answers that directly address the user's queries. If the query requires elaboration, break it into sections or use examples.
Be prepared to adjust your tone according to the user's needs—whether they require a formal, technical response or a more casual, conversational one.
3. Math and Coding Expertise:
When addressing math problems, ensure that calculations are correct and explain steps clearly. Use LaTeX formatting for mathematical expressions to enhance readability. Reason step-by-step. Check your work.
For coding tasks, provide clean, well-commented code snippets in the appropriate programming language. Explain the logic behind the code and suggest improvements or alternatives when necessary.
Be prepared to handle edge cases and offer error-checking advice in coding responses. For math, double-check your work to avoid inaccuracies.
4. Engagement and Adaptability:
Anticipate follow-up questions and provide information that guides the conversation forward.
Offer suggestions or clarifications proactively if the user's request is vague or open-ended.
Be polite, professional, and empathetic in your responses. Adapt to the user's emotional tone, providing encouragement or reassurance when appropriate.
5. Quality:
Remember that high-quality and clear responses are your goal. Always aim to provide responses that exemplify excellence in clarity, usefulness, and user engagement.
Avoid over-complicating responses with unnecessary details. Keep your answers focused and to the point.
6. Continuous Improvement:
Learn from user feedback and adjust your strategies to improve the quality of your formatting and content over time.
Keep refining your balance between aesthetic formatting and substantive content to enhance user experience."""
),
roles=("user", "assistant"),
sep_style=SeparatorStyle.DEFAULT,
sep=None,
)
)

# MetaMath default template
# reference: https://github.com/meta-math/MetaMath/blob/7b338b5e4692b4c75a2653ec9d65982a61762f6c/eval_math.py#L58
register_conv_template(
Expand Down Expand Up @@ -2321,19 +2271,6 @@ def get_conv_template(name: str) -> Conversation:
)
)

register_conv_template(
Conversation(
name="column-r",
system_message=(
"You are a smart and helpful AI assistant created by Column AI. "
"Please think step by step, provide detailed and professional response."
),
roles=("user", "assistant"),
sep_style=SeparatorStyle.DEFAULT,
sep=None,
)
)

register_conv_template(
Conversation(
name="grok-2",
Expand All @@ -2360,21 +2297,6 @@ def get_conv_template(name: str) -> Conversation:
)
)

register_conv_template(
Conversation(
name="toto",
system_message=(
"You are Toto, a brilliant and helpful Large Language Model made by Toto AI.\n"
"When presented with complicated questions that require multiple reasoning steps, "
"you work them step by step. You follow safety guidelines and avoid toxic, "
"violent or illegal content. When needed, you ask the user for clarifications or "
"extra information in order to perform the task as well as you can."
),
roles=("user", "assistant"),
sep_style=SeparatorStyle.DEFAULT,
sep=None,
)
)

if __name__ == "__main__":
from fastchat.conversation import get_conv_template
Expand Down
21 changes: 0 additions & 21 deletions fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@
"gpt2-chatbot",
"im-also-a-good-gpt2-chatbot",
"im-a-good-gpt2-chatbot",
"upcoming-gpt-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"anonymous-chatbot",
"anonymous-chatbot-0903",
"chatgpt-4o-latest-20240903",
"chatgpt-4o-latest",
"o1-preview",
Expand Down Expand Up @@ -1622,14 +1619,6 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("meta-llama-3.1")


class ColumnAdapter(BaseModelAdapter):
def match(self, model_path: str):
return "sus-column-r" in model_path.lower()

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("column-r")


class GrokAdapter(BaseModelAdapter):
def match(self, model_path: str):
return "grok" in model_path.lower()
Expand All @@ -1640,14 +1629,6 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("grok-2")


class TotoAdapter(BaseModelAdapter):
def match(self, model_path: str):
return "toto" in model_path.lower()

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("toto")


class CuteGPTAdapter(BaseModelAdapter):
"""The model adapter for CuteGPT"""

Expand Down Expand Up @@ -2619,8 +2600,6 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
register_model_adapter(SmaugChatAdapter)
register_model_adapter(Llama3Adapter)
register_model_adapter(Llama31Adapter)
register_model_adapter(ColumnAdapter)
register_model_adapter(TotoAdapter)
register_model_adapter(GrokAdapter)
register_model_adapter(NoSystemAdapter)

Expand Down
12 changes: 1 addition & 11 deletions fastchat/model/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def get_model_info(name: str) -> ModelInfo:
"gpt-4o-mini-2024-07-18",
"gpt-4o-2024-08-06",
"gpt-4o-2024-05-13",
"anonymous-chatbot",
"anonymous-chatbot-0903",
],
"GPT-4o",
"https://openai.com/index/hello-gpt-4o/",
Expand Down Expand Up @@ -128,8 +126,6 @@ def get_model_info(name: str) -> ModelInfo:
"gpt2-chatbot",
"im-also-a-good-gpt2-chatbot",
"im-a-good-gpt2-chatbot",
"upcoming-gpt-mini",
"sus-column-r",
],
"GPT-4-Turbo",
"https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo",
Expand Down Expand Up @@ -192,7 +188,7 @@ def get_model_info(name: str) -> ModelInfo:
)

register_model_info(
["athene-70b", "athene-70b-0725", "im-a-little-birdie"],
["athene-70b", "athene-70b-0725"],
"Athene-70B",
"https://nexusflow.ai/blogs/athene",
"A large language model by NexusFlow",
Expand Down Expand Up @@ -288,8 +284,6 @@ def get_model_info(name: str) -> ModelInfo:
"reka-flash-preview-20240611",
"reka-flash",
"reka-flash-online",
"pizza-model-small",
"pizza-model-large",
],
"Reka Flash",
"https://www.reka.ai/news/reka-flash-efficient-and-capable-multimodal-language-models",
Expand Down Expand Up @@ -336,8 +330,6 @@ def get_model_info(name: str) -> ModelInfo:
"mistral-next",
"mistral-7b-instruct-v0.2",
"mistral-7b-instruct",
"experimental-mf-router",
"experimental-causal-router",
"pixtral-12b-2409",
],
"Mixtral of experts",
Expand Down Expand Up @@ -488,8 +480,6 @@ def get_model_info(name: str) -> ModelInfo:
"vicuna-13b-v1.5",
"vicuna-7b",
"vicuna-7b-v1.5",
"column-r",
"column-u",
],
"Vicuna",
"https://lmsys.org/blog/2023-03-30-vicuna/",
Expand Down
75 changes: 3 additions & 72 deletions fastchat/serve/call_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,7 @@
import asyncio

REFRESH_INTERVAL_SEC = 300
LOG_DIR_LIST = [
"/home/gcpuser/fastchat_logs/server0",
"/home/gcpuser/fastchat_logs/server1",
"/home/gcpuser/fastchat_logs/server2",
"/home/gcpuser/fastchat_logs/server3",
"/home/gcpuser/fastchat_logs/server4",
"/home/gcpuser/fastchat_logs/server5",
"/home/gcpuser/fastchat_logs/server6",
"/home/gcpuser/fastchat_logs/server7",
"/home/gcpuser/fastchat_logs/server8",
"/home/gcpuser/fastchat_logs/server9",
"/home/gcpuser/fastchat_logs/server10",
"/home/gcpuser/fastchat_logs/server11",
"/home/gcpuser/fastchat_logs/server12",
"/home/gcpuser/fastchat_logs/server13",
"/home/gcpuser/fastchat_logs/server14",
"/home/gcpuser/fastchat_logs/server15",
"/home/gcpuser/fastchat_logs/server16",
"/home/gcpuser/fastchat_logs/server17",
]
LOG_DIR_LIST = []
# LOG_DIR = "/home/vicuna/tmp/test_env"


Expand All @@ -38,58 +19,8 @@ def __init__(self, log_dir_list: list):
self.log_dir_list = log_dir_list
self.model_call = {}
self.user_call = {}
self.model_call_limit_global = {
"gpt-4-1106-preview": 100,
"gpt-4-0125-preview": 100,
"gpt-4-turbo-browsing": 200,
"gpt-4-turbo-2024-04-09": 100,
"mistral-large-2402": 200,
"llama-3-70b-instruct": 2000,
"claude-3-opus-20240229": 1000,
"claude-3-sonnet-20240229": 1000,
"dbrx-instruct": 1000,
"command-r-plus": 1000,
"gemini-1.5-pro-api-0409-preview": 1000,
"gemini-1.5-pro-api-preview": 1000,
"gpt2-chatbot": 1000,
"im-a-good-gpt2-chatbot": 3000,
"im-also-a-good-gpt2-chatbot": 3000,
"gpt-4o-2024-05-13": 1000,
"gpt-4o-2024-08-06": 1000,
"yi-large": 300,
"deepseek-coder-v2": 500,
"deepseek-v2-api-0628": 300,
"claude-3-5-sonnet-20240620": 2000,
"experimental-mf-router": 100,
"experimental-causal-router": 100,
"llama-3.1-405b-instruct": 2000,
"gemini-1.5-pro-exp-0801": 800,
"sus-column-r": 3000,
"chatgpt-4o-latest-20240903": 1500,
}
self.model_call_day_limit_per_user = {
"gpt-4-1106-preview": 5,
"gpt-4-0125-preview": 5,
"gpt-4-turbo-2024-04-09": 5,
"gpt-4-turbo-browsing": 8,
"mistral-large-2402": 8,
"claude-3-opus-20240229": 15,
"claude-3-sonnet-20240229": 32,
"command-r-plus": 32,
"gemini-1.5-pro-api-0409-preview": 16,
"gemini-1.5-pro-api-preview": 16,
"gpt2-chatbot": 8,
"im-a-good-gpt2-chatbot": 16,
"im-also-a-good-gpt2-chatbot": 16,
"gpt-4o-2024-05-13": 8,
"gpt-4o-2024-08-06": 8,
"deepseek-coder-v2": 16,
"claude-3-5-sonnet-20240620": 16,
"llama-3.1-405b-instruct": 16,
"gemini-1.5-pro-exp-0801": 8,
"sus-column-r": 16,
"chatgpt-4o-latest-20240903": 8,
}
self.model_call_limit_global = {}
self.model_call_day_limit_per_user = {}

async def update_stats(self, num_file=1) -> None:
while True:
Expand Down

0 comments on commit c68199c

Please sign in to comment.