Created
June 17, 2023 19:36
-
-
Save xsa-dev/6603fa443cc2fe8fc5216fd1948ebbcf to your computer and use it in GitHub Desktop.
This quanaco model for LangChain integration. Subscribe me back =)
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
import os | |
import dotenv | |
from langchain import HuggingFaceTextGenInference | |
dotenv.load_dotenv() | |
os.environ[ | |
"HUGGINGFACEHUB_API_TOKEN" | |
] = os.getenv("HF_API_TOKEN") | |
llm = HuggingFaceTextGenInference( | |
inference_server_url="https://api-inference.huggingface.co/models/timdettmers/guanaco-33b-merged", | |
max_new_tokens=1024, | |
top_p=0.9, | |
temperature=0.7, | |
repetition_penalty=1.2, | |
) | |
if __name__ == "__main__": | |
print(llm("How are you today?")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment