Spaces:
Runtime error
Runtime error
Update chain_app.py
Browse files- chain_app.py +8 -10
chain_app.py
CHANGED
@@ -2607,7 +2607,7 @@ async def main(message: cl.Message):
|
|
2607 |
# complete_content = ''
|
2608 |
for event in stream:
|
2609 |
if event.event_type == 'text-generation':
|
2610 |
-
await msg.stream_token(event)
|
2611 |
# complete_content += event.text
|
2612 |
# await cl.Message(content=complete_content).send()
|
2613 |
|
@@ -2624,7 +2624,7 @@ async def main(message: cl.Message):
|
|
2624 |
complete_content = ''
|
2625 |
for event in stream:
|
2626 |
if event.event_type == 'text-generation':
|
2627 |
-
await msg.stream_token(event)
|
2628 |
|
2629 |
|
2630 |
elif chat_profile == 'Command-R-Plus':
|
@@ -2638,7 +2638,7 @@ async def main(message: cl.Message):
|
|
2638 |
complete_content = ''
|
2639 |
for event in stream:
|
2640 |
if event.event_type == 'text-generation':
|
2641 |
-
await msg.stream_token(event)
|
2642 |
|
2643 |
|
2644 |
elif chat_profile == 'Command-R':
|
@@ -2652,7 +2652,7 @@ async def main(message: cl.Message):
|
|
2652 |
complete_content = ''
|
2653 |
for event in stream:
|
2654 |
if event.event_type == 'text-generation':
|
2655 |
-
await msg.stream_token(event)
|
2656 |
|
2657 |
|
2658 |
elif chat_profile == 'Command':
|
@@ -2666,7 +2666,7 @@ async def main(message: cl.Message):
|
|
2666 |
complete_content = ''
|
2667 |
for event in stream:
|
2668 |
if event.event_type == 'text-generation':
|
2669 |
-
await msg.stream_token(event)
|
2670 |
|
2671 |
|
2672 |
elif chat_profile == 'Command-Light':
|
@@ -2680,7 +2680,7 @@ async def main(message: cl.Message):
|
|
2680 |
complete_content = ''
|
2681 |
for event in stream:
|
2682 |
if event.event_type == 'text-generation':
|
2683 |
-
await msg.stream_token(event)
|
2684 |
|
2685 |
elif chat_profile == 'Command-Light-Nightly':
|
2686 |
stream = co.chat_stream(
|
@@ -2693,7 +2693,7 @@ async def main(message: cl.Message):
|
|
2693 |
complete_content = ''
|
2694 |
for event in stream:
|
2695 |
if event.event_type == 'text-generation':
|
2696 |
-
await msg.stream_token(event)
|
2697 |
|
2698 |
|
2699 |
elif chat_profile == 'Command-Nightly':
|
@@ -2707,9 +2707,7 @@ async def main(message: cl.Message):
|
|
2707 |
complete_content = ''
|
2708 |
for event in stream:
|
2709 |
if event.event_type == 'text-generation':
|
2710 |
-
await msg.stream_token(event)
|
2711 |
-
|
2712 |
-
|
2713 |
|
2714 |
@cl.on_settings_update
|
2715 |
async def setup_agent(settings):
|
|
|
2607 |
# complete_content = ''
|
2608 |
for event in stream:
|
2609 |
if event.event_type == 'text-generation':
|
2610 |
+
await msg.stream_token(event.text)
|
2611 |
# complete_content += event.text
|
2612 |
# await cl.Message(content=complete_content).send()
|
2613 |
|
|
|
2624 |
complete_content = ''
|
2625 |
for event in stream:
|
2626 |
if event.event_type == 'text-generation':
|
2627 |
+
await msg.stream_token(event.text)
|
2628 |
|
2629 |
|
2630 |
elif chat_profile == 'Command-R-Plus':
|
|
|
2638 |
complete_content = ''
|
2639 |
for event in stream:
|
2640 |
if event.event_type == 'text-generation':
|
2641 |
+
await msg.stream_token(event.text)
|
2642 |
|
2643 |
|
2644 |
elif chat_profile == 'Command-R':
|
|
|
2652 |
complete_content = ''
|
2653 |
for event in stream:
|
2654 |
if event.event_type == 'text-generation':
|
2655 |
+
await msg.stream_token(event.text)
|
2656 |
|
2657 |
|
2658 |
elif chat_profile == 'Command':
|
|
|
2666 |
complete_content = ''
|
2667 |
for event in stream:
|
2668 |
if event.event_type == 'text-generation':
|
2669 |
+
await msg.stream_token(event.text)
|
2670 |
|
2671 |
|
2672 |
elif chat_profile == 'Command-Light':
|
|
|
2680 |
complete_content = ''
|
2681 |
for event in stream:
|
2682 |
if event.event_type == 'text-generation':
|
2683 |
+
await msg.stream_token(event.text)
|
2684 |
|
2685 |
elif chat_profile == 'Command-Light-Nightly':
|
2686 |
stream = co.chat_stream(
|
|
|
2693 |
complete_content = ''
|
2694 |
for event in stream:
|
2695 |
if event.event_type == 'text-generation':
|
2696 |
+
await msg.stream_token(event.text)
|
2697 |
|
2698 |
|
2699 |
elif chat_profile == 'Command-Nightly':
|
|
|
2707 |
complete_content = ''
|
2708 |
for event in stream:
|
2709 |
if event.event_type == 'text-generation':
|
2710 |
+
await msg.stream_token(event.text)
|
|
|
|
|
2711 |
|
2712 |
@cl.on_settings_update
|
2713 |
async def setup_agent(settings):
|