Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,10 @@ from huggingface_hub import InferenceClient
|
|
| 5 |
MODEL_ID = "MiniMaxAI/MiniMax-M2.5"
|
| 6 |
SYSTEM_PROMPT = "You are a helpful assistant. Your name is MiniMax-M2.5 and is built by MiniMax."
|
| 7 |
|
| 8 |
-
client = InferenceClient(
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
@@ -21,7 +24,8 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
| 21 |
|
| 22 |
response = ""
|
| 23 |
for chunk in client.chat_completion(
|
| 24 |
-
|
|
|
|
| 25 |
max_tokens=max_tokens,
|
| 26 |
stream=True,
|
| 27 |
temperature=temperature,
|
|
|
|
| 5 |
MODEL_ID = "MiniMaxAI/MiniMax-M2.5"
|
| 6 |
SYSTEM_PROMPT = "You are a helpful assistant. Your name is MiniMax-M2.5 and is built by MiniMax."
|
| 7 |
|
| 8 |
+
client = InferenceClient(
|
| 9 |
+
provider="novita",
|
| 10 |
+
api_key=os.environ.get("HF_TOKEN"),
|
| 11 |
+
)
|
| 12 |
|
| 13 |
|
| 14 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
|
|
| 24 |
|
| 25 |
response = ""
|
| 26 |
for chunk in client.chat_completion(
|
| 27 |
+
MODEL_ID,
|
| 28 |
+
messages=messages,
|
| 29 |
max_tokens=max_tokens,
|
| 30 |
stream=True,
|
| 31 |
temperature=temperature,
|