Skip to content

Instantly share code, notes, and snippets.

@xsa-dev
Created June 17, 2023 19:36
Show Gist options
  • Save xsa-dev/6603fa443cc2fe8fc5216fd1948ebbcf to your computer and use it in GitHub Desktop.
Save xsa-dev/6603fa443cc2fe8fc5216fd1948ebbcf to your computer and use it in GitHub Desktop.
This quanaco model for LangChain integration. Subscribe me back =)
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