Spaces:
Sleeping
Sleeping
Utkarsh Verma
commited on
Commit
Β·
460380b
1
Parent(s):
65d1591
Code Change
Browse files
app.py
CHANGED
@@ -22,15 +22,16 @@ def chat():
|
|
22 |
return jsonify({"error": "Empty message received"})
|
23 |
|
24 |
try:
|
|
|
25 |
payload = {
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
32 |
}
|
33 |
-
}
|
34 |
response = requests.post(API_URL, headers=headers, json=payload)
|
35 |
data = response.json()
|
36 |
# print(response.status_code) # Debugging: Print the HTTP status
|
|
|
22 |
return jsonify({"error": "Empty message received"})
|
23 |
|
24 |
try:
|
25 |
+
formatted_prompt = f"User: {user_message}\nBot:"
|
26 |
payload = {
|
27 |
+
"inputs": formatted_prompt,
|
28 |
+
"parameters": {
|
29 |
+
"temperature": 0.5,
|
30 |
+
"top_p": 0.9,
|
31 |
+
"max_new_tokens": 100,
|
32 |
+
"stop_sequences": ["\nUser:", "User:", "\n"]
|
33 |
+
}
|
34 |
}
|
|
|
35 |
response = requests.post(API_URL, headers=headers, json=payload)
|
36 |
data = response.json()
|
37 |
# print(response.status_code) # Debugging: Print the HTTP status
|