mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
(test) hf streaming
This commit is contained in:
parent
04971674b4
commit
2dc411fdb3
1 changed files with 12 additions and 7 deletions
|
|
@ -155,11 +155,16 @@ def test_completion_hf_prompt_array():
|
|||
# test_completion_hf_prompt_array()
|
||||
|
||||
def test_text_completion_stream():
|
||||
response = text_completion(
|
||||
model="huggingface/mistralai/Mistral-7B-v0.1",
|
||||
prompt="good morning",
|
||||
stream=True
|
||||
)
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
try:
|
||||
response = text_completion(
|
||||
model="huggingface/mistralai/Mistral-7B-v0.1",
|
||||
prompt="good morning",
|
||||
stream=True,
|
||||
max_tokens=10,
|
||||
)
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
pytest.fail(f"GOT exception for HF In streaming{e}")
|
||||
|
||||
test_text_completion_stream()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue