-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15944eb
commit 1b4aadb
Showing
4 changed files
with
85 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,49 @@ | ||
# import sys, os | ||
# import traceback | ||
# from dotenv import load_dotenv | ||
# load_dotenv() | ||
# import os | ||
# sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path | ||
# import pytest | ||
# import litellm | ||
# from litellm import embedding, completion | ||
import sys, os | ||
import traceback | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
import os | ||
sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path | ||
import pytest | ||
import litellm | ||
from litellm import embedding, completion | ||
|
||
|
||
# litellm.vertex_project = "hardy-device-386718" | ||
# litellm.vertex_location = "us-central1" | ||
litellm.vertex_project = "hardy-device-386718" | ||
litellm.vertex_location = "us-central1" | ||
litellm.set_verbose = True | ||
|
||
# user_message = "what's the weather in SF " | ||
# messages = [{ "content": user_message,"role": "user"}] | ||
user_message = "what's the weather in SF " | ||
messages = [{ "content": user_message,"role": "user"}] | ||
|
||
# def logger_fn(user_model_dict): | ||
# print(f"user_model_dict: {user_model_dict}") | ||
# chat-bison | ||
# response = completion(model="chat-bison", messages=messages, temperature=0.5, top_p=0.1) | ||
# print(response) | ||
|
||
# text-bison | ||
|
||
# # chat_model = ChatModel.from_pretrained("chat-bison@001") | ||
# # parameters = { | ||
# # "temperature": 0.2, | ||
# # "max_output_tokens": 256, | ||
# # "top_p": 0.8, | ||
# # "top_k": 40 | ||
# # } | ||
# response = completion(model="text-bison@001", messages=messages) | ||
# print(response) | ||
|
||
# response = completion(model="text-bison@001", messages=messages, temperature=0.1, logger_fn=logger_fn) | ||
# print(response) | ||
|
||
# response = completion(model="text-bison@001", messages=messages, temperature=0.4, top_p=0.1, logger_fn=logger_fn) | ||
# print(response) | ||
|
||
# response = completion(model="text-bison@001", messages=messages, temperature=0.8, top_p=0.4, top_k=30, logger_fn=logger_fn) | ||
# print(response) | ||
|
||
# chat_model = ChatModel.from_pretrained("chat-bison@001") | ||
# parameters = { | ||
# "temperature": 0.2, | ||
# "max_output_tokens": 256, | ||
# "top_p": 0.8, | ||
# "top_k": 40 | ||
# } | ||
|
||
# # chat = chat_model.start_chat() | ||
# # response = chat.send_message("who are u? write a sentence", **parameters) | ||
# # print(f"Response from Model: {response.text}") | ||
# chat = chat_model.start_chat() | ||
# response = chat.send_message("who are u? write a sentence", **parameters) | ||
# print(f"Response from Model: {response.text}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters