Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def generate_response():
|
|
41 |
messages = messages[1:]
|
42 |
|
43 |
payload = json.dumps({
|
44 |
-
'model': '
|
45 |
'messages': messages,
|
46 |
'max_tokens': 4096,
|
47 |
'temperature': 0.7,
|
@@ -65,7 +65,7 @@ def stream_response(resp):
|
|
65 |
if len(line) == 0:
|
66 |
continue
|
67 |
r = json.loads(line[6:])
|
68 |
-
content = r['
|
69 |
yield content[last_length:]
|
70 |
last_length = len(content)
|
71 |
|
|
|
41 |
messages = messages[1:]
|
42 |
|
43 |
payload = json.dumps({
|
44 |
+
'model': 'nanbeige2-turbo-0611',
|
45 |
'messages': messages,
|
46 |
'max_tokens': 4096,
|
47 |
'temperature': 0.7,
|
|
|
65 |
if len(line) == 0:
|
66 |
continue
|
67 |
r = json.loads(line[6:])
|
68 |
+
content = r['choices'][0]['delta']['content']
|
69 |
yield content[last_length:]
|
70 |
last_length = len(content)
|
71 |
|