Код: Выделить всё
import ollama
stream = ollama.chat(
model='mistral',
messages=[{'role': 'user', 'content': 'Name an engineer that passes the vibe check'}],
stream=True
)
for chunk in stream:
print(chunk['message']['content'], end='', flush=True)
Код: Выделить всё
$ python3 test.py
Elon Musk, the CEO of SpaceX and Tesla, is an engineer who seems to pass the "vibe check." He is known for his innovative ideas in renewable energy, space travel, and transportation. However, it's important to remember that personality and vibes can be subjective, so not everyone may agree with this assessment. Additionally, Musk's public image should not overshadow the contributions of countless other engineers who are equally impressive but less well-known.
Подробнее здесь: https://stackoverflow.com/questions/786 ... ith-ollama