Replies: 2 comments 1 reply
-
I think this is a result of the default callback_handler of strands where it prints the response for you. Does the issue go away if you set |
Beta Was this translation helpful? Give feedback.
0 replies
-
@zastrowm , thank you, agent = Agent(model=model, callback_handler=None ) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to stream an ai model served with llama-server, and hitting an error:
llama-server -m ~/llms/mistral-nemo-15.gguf -c 4096
The expected output should have been:
Nepal is home to the world's highest peak, Mount Everest. The country is known for its ancient temples and rich cultural heritage.
But some letters are repeating:
$ python scripts/stream.py
NNepepalal is is renowned renowned for for its its stunning stunning Himal Himalayasayas,, including including Mount Mount Ever Everestest.. The The country country is is also also rich rich in in cultural cultural diversity diversity,, with with over over 110000 ethnic ethnic groups groups..
I tried debugging the agent_stream object and noticed that some characters appear before each 'data' object, whose value is the same as the value inside the data object, eg:
Notice 'N' appearing just before the {'data': {}} object ? This is basically happening for each new streaming object that is generated, and seems to be causing the repetition in the response.
N{'data': 'N', 'delta': {'text': 'N'}, 'agent': <strands.agent.agent.Agent object at 0x108df4cd0>, 'event_loop_cycle_id': UUID('b874af09-b7b5-4f9d-871b-e960abcadb13'), 'request_state': {}, 'event_loop_cycle_trace': <strands.telemetry.metrics.Trace object at 0x1096c6e10>, 'event_loop_cycle_span': NonRecordingSpan(SpanContext(trace_id=0x00000000000000000000000000000000, span_id=0x0000000000000000, trace_flags=0x00, trace_state=[], is_remote=False))}
Here is the whole output for debugging:
Can someone please guide me on how to get this right ?
Beta Was this translation helpful? Give feedback.
All reactions