Instructions to use momergul/git_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use momergul/git_test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="momergul/git_test", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("momergul/git_test", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("momergul/git_test", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use momergul/git_test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "momergul/git_test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "momergul/git_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/momergul/git_test
- SGLang
How to use momergul/git_test with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "momergul/git_test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "momergul/git_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "momergul/git_test" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "momergul/git_test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use momergul/git_test with Docker Model Runner:
docker model run hf.co/momergul/git_test
Upload modeling_git.py with huggingface_hub
Browse files- modeling_git.py +1 -0
modeling_git.py
CHANGED
|
@@ -53,6 +53,7 @@ class GitForCausalLM(modeling_git.GitForCausalLM):
|
|
| 53 |
output_attentions: Optional[bool] = None,
|
| 54 |
output_hidden_states: Optional[bool] = None,
|
| 55 |
return_dict: Optional[bool] = None,
|
|
|
|
| 56 |
) -> Union[Tuple[torch.Tensor], modeling_git.CausalLMOutputWithPast]:
|
| 57 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 58 |
if labels is not None:
|
|
|
|
| 53 |
output_attentions: Optional[bool] = None,
|
| 54 |
output_hidden_states: Optional[bool] = None,
|
| 55 |
return_dict: Optional[bool] = None,
|
| 56 |
+
**kwargs,
|
| 57 |
) -> Union[Tuple[torch.Tensor], modeling_git.CausalLMOutputWithPast]:
|
| 58 |
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 59 |
if labels is not None:
|