Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,12 +43,12 @@ def generate_response(user_input, relevant_context=""):
|
|
| 43 |
{"role": "user", "content": combined_input}
|
| 44 |
],
|
| 45 |
max_tokens=150,
|
| 46 |
-
temperature=0.
|
| 47 |
top_p=0.9,
|
| 48 |
frequency_penalty=0.5,
|
| 49 |
presence_penalty=0.0
|
| 50 |
)
|
| 51 |
-
return response.choices[0].message
|
| 52 |
|
| 53 |
def chatbot(user_input, context="", use_encoder=False):
|
| 54 |
if use_encoder and context:
|
|
|
|
| 43 |
{"role": "user", "content": combined_input}
|
| 44 |
],
|
| 45 |
max_tokens=150,
|
| 46 |
+
temperature=0.5,
|
| 47 |
top_p=0.9,
|
| 48 |
frequency_penalty=0.5,
|
| 49 |
presence_penalty=0.0
|
| 50 |
)
|
| 51 |
+
return response.choices[0].message.content.strip()
|
| 52 |
|
| 53 |
def chatbot(user_input, context="", use_encoder=False):
|
| 54 |
if use_encoder and context:
|