Spaces:
Build error
Build error
Download src/model.py from sajmahmo/agents-basics: direct link, hf CLI and curl.
- Browser
- Download file 438 Bytes
-
https://huggingface.co/spaces/sajmahmo/agents-basics/resolve/main/src/model.py
- Command line
-
hf download hf://spaces/sajmahmo/agents-basics/src/model.py
-
curl -L -o model.py https://huggingface.co/spaces/sajmahmo/agents-basics/resolve/main/src/model.py
438 Bytes
| from smolagents import HfApiModel | |
| def get_model( | |
| model_id: str, | |
| provider: str, | |
| max_tokens: int = 2048, | |
| **kwargs | |
| ) -> HfApiModel: | |
| return HfApiModel( | |
| model_id=model_id, | |
| provider=provider, | |
| max_tokens=max_tokens, | |
| **kwargs | |
| ) | |
| if __name__ == "__main__": | |
| ModelId = "Qwen/Qwen2.5-Coder-32B-Instruct" | |
| Provider = "together" | |
| model = get_model(ModelId, Provider) |