Spaces:
Sleeping
Sleeping
Download tests/llm_test.py from Samagra07/LinkedIn-Post-Generator: direct link, hf CLI and curl.
- Browser
- Download file 577 Bytes
-
https://huggingface.co/spaces/Samagra07/LinkedIn-Post-Generator/resolve/main/tests/llm_test.py
- Command line
-
hf download hf://spaces/Samagra07/LinkedIn-Post-Generator/tests/llm_test.py
-
curl -L -o llm_test.py https://huggingface.co/spaces/Samagra07/LinkedIn-Post-Generator/resolve/main/tests/llm_test.py
577 Bytes
| from langchain_openai import AzureChatOpenAI | |
| from config.configs import AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, OPENAI_API_VERSION, AZURE_DEPLOYMENT | |
| import os | |
| os.environ['AZURE_OPENAI_API_KEY'] = AZURE_OPENAI_API_KEY | |
| os.environ['OPENAI_API_VERSION'] = OPENAI_API_VERSION | |
| os.environ['AZURE_OPENAI_ENDPOINT'] = AZURE_OPENAI_ENDPOINT | |
| LLM = AzureChatOpenAI( | |
| azure_deployment=AZURE_DEPLOYMENT, | |
| temperature=0, | |
| max_tokens=None, | |
| timeout=None, | |
| max_retries=2, | |
| ) | |
| if __name__ == "__main__": | |
| response = LLM.invoke("hello, how are you") | |
| print(response) |