Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,12 +23,13 @@ def get_response(user_message, history, verbosity):
|
|
| 23 |
# Adjust the temperature based on the verbosity level
|
| 24 |
temperature = 0.5 if verbosity == "Balanced" else 0.3 if verbosity == "Concise" else 0.7
|
| 25 |
|
| 26 |
-
# Make the API call
|
| 27 |
response = client.chat.completions.create(
|
| 28 |
model='ambrosfitz/llama-3-history',
|
| 29 |
messages=history_openai_format,
|
| 30 |
temperature=temperature,
|
| 31 |
-
max_tokens=
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# Access the text response
|
|
|
|
| 23 |
# Adjust the temperature based on the verbosity level
|
| 24 |
temperature = 0.5 if verbosity == "Balanced" else 0.3 if verbosity == "Concise" else 0.7
|
| 25 |
|
| 26 |
+
# Make the API call with a custom stop sequence
|
| 27 |
response = client.chat.completions.create(
|
| 28 |
model='ambrosfitz/llama-3-history',
|
| 29 |
messages=history_openai_format,
|
| 30 |
temperature=temperature,
|
| 31 |
+
max_tokens=150,
|
| 32 |
+
stop=["<|eot_id|>"] # Add a custom stop sequence
|
| 33 |
)
|
| 34 |
|
| 35 |
# Access the text response
|