Download src/model.py from HFswapnil/ChatAI: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/HFswapnil/ChatAI/resolve/main/src/model.py
- Command line
-
hf download hf://spaces/HFswapnil/ChatAI/src/model.py
-
curl -L -o model.py https://huggingface.co/spaces/HFswapnil/ChatAI/resolve/main/src/model.py
493 Bytes
| from langchain_google_genai import ChatGoogleGenerativeAI | |
| import os | |
| GOOGLE_API_KEY = os.environ.get("GOOGLE_API_KEY") | |
| def get_gemma(temperature=0, top_k=40, top_p=0.95): | |
| gemma_model = ChatGoogleGenerativeAI( | |
| model="gemma-3-12b-it", | |
| temperature=temperature, | |
| max_tokens=2048, | |
| timeout=None, | |
| max_retries=2, | |
| google_api_key=GOOGLE_API_KEY, | |
| top_k=top_k, | |
| top_p=top_p | |
| ) | |
| return gemma_model |