Spaces:
Runtime error
Runtime error
Update chain_app.py
Browse files- chain_app.py +17 -14
chain_app.py
CHANGED
|
@@ -2146,9 +2146,24 @@ async def main(message: cl.Message):
|
|
| 2146 |
for part in stream:
|
| 2147 |
if token := part.choices[0].delta.content or "":
|
| 2148 |
await msg.stream_token(token)
|
| 2149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2150 |
stream = completion = openai_client.chat.completions.create(
|
| 2151 |
-
model="
|
| 2152 |
messages=[
|
| 2153 |
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"},
|
| 2154 |
{"role": "user", "content": message.content}
|
|
@@ -2159,18 +2174,6 @@ async def main(message: cl.Message):
|
|
| 2159 |
for part in stream:
|
| 2160 |
if token := part.choices[0].delta.content or "":
|
| 2161 |
await msg.stream_token(token)
|
| 2162 |
-
elif chat_profile == 'gpt-3.5-turbo-1106':
|
| 2163 |
-
completion = openai_client.chat.completions.create(
|
| 2164 |
-
model="gpt-3.5-turbo-1106",
|
| 2165 |
-
messages=[
|
| 2166 |
-
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"},
|
| 2167 |
-
{"role": "user", "content": message.content}
|
| 2168 |
-
]
|
| 2169 |
-
)
|
| 2170 |
-
model_response = completion.choices[0].message.content
|
| 2171 |
-
await cl.Message(
|
| 2172 |
-
content=model_response
|
| 2173 |
-
).send()
|
| 2174 |
# elif chat_profile == 'davinci-002':
|
| 2175 |
# completion = openai_client.chat.completions.create(
|
| 2176 |
# model="davinci-002",
|
|
|
|
| 2146 |
for part in stream:
|
| 2147 |
if token := part.choices[0].delta.content or "":
|
| 2148 |
await msg.stream_token(token)
|
| 2149 |
+
|
| 2150 |
+
# elif chat_profile == 'GPT-3.5-turbo-0125':
|
| 2151 |
+
# stream = completion = openai_client.chat.completions.create(
|
| 2152 |
+
# model="GPT-3.5-turbo-0125",
|
| 2153 |
+
# messages=[
|
| 2154 |
+
# {"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"},
|
| 2155 |
+
# {"role": "user", "content": message.content}
|
| 2156 |
+
# ],
|
| 2157 |
+
# stream=True
|
| 2158 |
+
# )
|
| 2159 |
+
|
| 2160 |
+
# for part in stream:
|
| 2161 |
+
# if token := part.choices[0].delta.content or "":
|
| 2162 |
+
# await msg.stream_token(token)
|
| 2163 |
+
|
| 2164 |
+
elif chat_profile == 'gpt-3.5-turbo-1106':
|
| 2165 |
stream = completion = openai_client.chat.completions.create(
|
| 2166 |
+
model="gpt-3.5-turbo-1106",
|
| 2167 |
messages=[
|
| 2168 |
{"role": "system", "content": f"You are neural nexus official chatbot, you are made by Artin Daneshvar and Sadra Noadoust and you are here to help people"},
|
| 2169 |
{"role": "user", "content": message.content}
|
|
|
|
| 2174 |
for part in stream:
|
| 2175 |
if token := part.choices[0].delta.content or "":
|
| 2176 |
await msg.stream_token(token)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2177 |
# elif chat_profile == 'davinci-002':
|
| 2178 |
# completion = openai_client.chat.completions.create(
|
| 2179 |
# model="davinci-002",
|