Skip to content

Commit

Permalink
test(test_caching.py): reset to none
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Oct 24, 2023
1 parent 029084c commit 3ec103f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions litellm/tests/litellm_results.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DFcOhvi41mgdtH6WBVzGKWOVAvpG", "object": "chat.completion", "created": 1698168992, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have direct access to real-time information or the ability to browse the internet. Therefore, I cannot provide you with the latest scientific discoveries. Scientific discoveries are constantly being made across various fields, including physics, chemistry, biology, medicine, and more. To stay up to date with the latest scientific breakthroughs, I recommend referring to reputable scientific journals or news outlets that cover recent scientific research."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 86, "total_tokens": 103}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DG44xxtT4lsAoVX1rHlC6CJaUjUK", "object": "chat.completion", "created": 1698170708, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have real-time data or the ability to browse the internet. Therefore, I cannot provide information on the latest scientific discoveries. Discoveries and breakthroughs occur regularly in various fields of science, including biology, physics, chemistry, and more. To stay updated on the latest scientific discoveries, I recommend referring to reliable sources like scientific journals, news outlets, or university and research institute websites that cover recent scientific breakthroughs."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 91, "total_tokens": 108}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DG4449c5ZTIrzJ6s0eslGRib3Jw3", "object": "chat.completion", "created": 1698170708, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have access to real-time information or the ability to browse the internet. Consequently, I cannot provide a summary of the very latest scientific discoveries. However, I can provide a general overview of some significant recent discoveries from various scientific fields that have been covered in the news. Keep in mind that these summaries are not exhaustive and may not include the most recent breakthroughs:\n\n1. Astrophysics: In April 2019, the Event Horizon Telescope captured the first-ever image of a black hole in the center of the galaxy Messier 87. This provided dramatic evidence supporting Einstein's theory of general relativity.\n\n2. Medicine: In November 2020, the Pfizer/BioNTech and Moderna COVID-19 vaccines were announced, marking significant progress in the fight against the global pandemic. Both vaccines utilize mRNA technology to stimulate an immune response to the virus.\n\n3. Quantum Computing: In October 2019, Google claimed to have achieved \"quantum supremacy\" by solving a calculation that would have taken the world's most powerful supercomputer thousands of years in just 200 seconds.\n\n4. Genetics: CRISPR-Cas9, a revolutionary gene-editing technology, has made significant strides in recent years. Researchers have successfully edited genes in human embryos to correct genetic mutations, opening up possibilities for treating otherwise incurable genetic diseases.\n\n5. Climate Change: Scientists have been studying the impacts of climate change and their consequences. Recent findings include increased melting of polar ice caps, rising sea levels, and the higher frequency and intensity of extreme weather events like hurricanes and heatwaves.\n\nPlease note that these summaries might not represent the most recent scientific discoveries in each field. Scientific advancements occur at a rapid pace, and it is best to refer to reputable scientific journals, news outlets, or academic sources for the most up-to-date information."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 373, "total_tokens": 390}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DHsKHZnQN3G40eCJrlM94FJp5bqo", "object": "chat.completion", "created": 1698177668, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "As an AI language model, I don't have direct access to real-time information or the ability to browse the internet. Thus, I can't provide a summary of the latest scientific discoveries. My responses are generated based on a mixture of licensed data, data created by human trainers, and publicly available data. So, I can provide general information about scientific discoveries, but I won't be familiar with specific, recent breakthroughs or studies. It's always best to refer to trusted scientific sources and news outlets for the most up-to-date information regarding the latest discoveries."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 112, "total_tokens": 129}}]
[{"model": "gpt-3.5-turbo-16k", "messages": [{"content": "Please provide a summary of the latest scientific discoveries.", "role": "user"}], "api_key": "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"}, {"id": "chatcmpl-8DHsKrhGvSMqWH6yUkfp3KoVpfkKM", "object": "chat.completion", "created": 1698177668, "model": "gpt-3.5-turbo-16k-0613", "choices": [{"index": 0, "message": {"role": "assistant", "content": "It is impossible for me to provide a summary of the latest scientific discoveries as they are constantly evolving and being published across various fields. However, some notable recent scientific findings include advancements in COVID-19 research and vaccinations, breakthroughs in quantum computing and artificial intelligence, progress in understanding climate change and its impacts, developments in medical treatments and gene editing technologies, and discoveries in space exploration and astronomy. These are just a few examples, and there are countless more scientific discoveries being made every day across different disciplines all over the world."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 17, "completion_tokens": 104, "total_tokens": 121}}]
2 changes: 2 additions & 0 deletions litellm/tests/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def get_cache(key):

if response3['choices'][0]['message']['content'] == response2['choices'][0]['message']['content']:
pytest.fail(f"Error occurred:")
litellm.cache = None

test_custom_redis_cache_with_key()

Expand All @@ -359,6 +360,7 @@ def test_hosted_cache():
print(f"response1: {response1}")
print(f"response2: {response2}")
pytest.fail(f"Hosted cache: Response2 is not cached and the same as response 1")
litellm.cache = None

# test_hosted_cache()

26 changes: 13 additions & 13 deletions litellm/tests/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,19 +800,19 @@ def test_completion_together_ai():
# except Exception as e:
# pytest.fail(f"Error occurred: {e}")

def test_completion_sagemaker():
try:
response = completion(
model="sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b",
messages=messages,
temperature=0.2,
max_tokens=80,
logger_fn=logger_fn
)
# Add any assertions here to check the response
print(response)
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# def test_completion_sagemaker():
# try:
# response = completion(
# model="sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b",
# messages=messages,
# temperature=0.2,
# max_tokens=80,
# logger_fn=logger_fn
# )
# # Add any assertions here to check the response
# print(response)
# except Exception as e:
# pytest.fail(f"Error occurred: {e}")

# test_completion_sagemaker()

Expand Down

0 comments on commit 3ec103f

Please sign in to comment.