Spaces:
Sleeping
Sleeping
Daniel Szpisjak
commited on
Commit
·
23b838b
1
Parent(s):
457f872
fix(app): correct call signature
Browse files
app.py
CHANGED
|
@@ -37,13 +37,16 @@ def respond(
|
|
| 37 |
response = ""
|
| 38 |
|
| 39 |
try:
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
max_tokens=max_tokens,
|
| 43 |
stream=True,
|
| 44 |
temperature=temperature,
|
| 45 |
top_p=top_p,
|
| 46 |
-
)
|
|
|
|
|
|
|
| 47 |
token = message.choices[0].delta.content
|
| 48 |
|
| 49 |
if token:
|
|
|
|
| 37 |
response = ""
|
| 38 |
|
| 39 |
try:
|
| 40 |
+
chat_completion = client.chat.completions.create(
|
| 41 |
+
model="tgi",
|
| 42 |
+
messages=messages,
|
| 43 |
max_tokens=max_tokens,
|
| 44 |
stream=True,
|
| 45 |
temperature=temperature,
|
| 46 |
top_p=top_p,
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
for message in chat_completion:
|
| 50 |
token = message.choices[0].delta.content
|
| 51 |
|
| 52 |
if token:
|