Instructions to use Mayura01/T-CLM2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mayura01/T-CLM2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mayura01/T-CLM2")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Mayura01/T-CLM2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mayura01/T-CLM2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mayura01/T-CLM2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mayura01/T-CLM2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mayura01/T-CLM2
- SGLang
How to use Mayura01/T-CLM2 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 "Mayura01/T-CLM2" \ --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": "Mayura01/T-CLM2", "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 "Mayura01/T-CLM2" \ --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": "Mayura01/T-CLM2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Mayura01/T-CLM2 with Docker Model Runner:
docker model run hf.co/Mayura01/T-CLM2
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
---
|
| 2 |
license: mit
|
| 3 |
pipeline_tag: text-generation
|
| 4 |
tags:
|
|
@@ -12,185 +11,63 @@ base_model:
|
|
| 12 |
- Mayura01/T-CLM2
|
| 13 |
library_name: transformers
|
| 14 |
---
|
| 15 |
-
# Model Card for
|
| 16 |
-
|
| 17 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 18 |
|
| 19 |
-
This
|
| 20 |
|
| 21 |
## Model Details
|
| 22 |
|
| 23 |
### Model Description
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
- **Developed by:** Mayura
|
| 30 |
- **Model type:** Transformer Decoder only model
|
| 31 |
-
- **Language(s)
|
| 32 |
|
| 33 |
## Uses
|
| 34 |
|
| 35 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 36 |
-
|
| 37 |
### Direct Use
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
[More Information Needed]
|
| 42 |
|
| 43 |
### Downstream Use [optional]
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
[More Information Needed]
|
| 48 |
|
| 49 |
### Out-of-Scope Use
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
[More Information Needed]
|
| 54 |
|
| 55 |
## Bias, Risks, and Limitations
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
[More Information Needed]
|
| 60 |
|
| 61 |
### Recommendations
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 66 |
|
| 67 |
## How to Get Started with the Model
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
[More Information Needed]
|
| 72 |
-
|
| 73 |
-
## Training Details
|
| 74 |
-
|
| 75 |
-
### Training Data
|
| 76 |
-
|
| 77 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 78 |
-
|
| 79 |
-
[More Information Needed]
|
| 80 |
-
|
| 81 |
-
### Training Procedure
|
| 82 |
-
|
| 83 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 84 |
-
|
| 85 |
-
#### Preprocessing [optional]
|
| 86 |
-
|
| 87 |
-
[More Information Needed]
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
#### Training Hyperparameters
|
| 91 |
-
|
| 92 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 93 |
-
|
| 94 |
-
#### Speeds, Sizes, Times [optional]
|
| 95 |
-
|
| 96 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 97 |
-
|
| 98 |
-
[More Information Needed]
|
| 99 |
-
|
| 100 |
-
## Evaluation
|
| 101 |
-
|
| 102 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 103 |
-
|
| 104 |
-
### Testing Data, Factors & Metrics
|
| 105 |
-
|
| 106 |
-
#### Testing Data
|
| 107 |
-
|
| 108 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 109 |
-
|
| 110 |
-
[More Information Needed]
|
| 111 |
-
|
| 112 |
-
#### Factors
|
| 113 |
-
|
| 114 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 115 |
-
|
| 116 |
-
[More Information Needed]
|
| 117 |
-
|
| 118 |
-
#### Metrics
|
| 119 |
-
|
| 120 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 121 |
-
|
| 122 |
-
[More Information Needed]
|
| 123 |
-
|
| 124 |
-
### Results
|
| 125 |
-
|
| 126 |
-
[More Information Needed]
|
| 127 |
-
|
| 128 |
-
#### Summary
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
## Model Examination [optional]
|
| 133 |
-
|
| 134 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 135 |
-
|
| 136 |
-
[More Information Needed]
|
| 137 |
-
|
| 138 |
-
## Environmental Impact
|
| 139 |
-
|
| 140 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 141 |
-
|
| 142 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 143 |
-
|
| 144 |
-
- **Hardware Type:** [More Information Needed]
|
| 145 |
-
- **Hours used:** [More Information Needed]
|
| 146 |
-
- **Cloud Provider:** [More Information Needed]
|
| 147 |
-
- **Compute Region:** [More Information Needed]
|
| 148 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 149 |
-
|
| 150 |
-
## Technical Specifications [optional]
|
| 151 |
-
|
| 152 |
-
### Model Architecture and Objective
|
| 153 |
-
|
| 154 |
-
[More Information Needed]
|
| 155 |
-
|
| 156 |
-
### Compute Infrastructure
|
| 157 |
-
|
| 158 |
-
[More Information Needed]
|
| 159 |
-
|
| 160 |
-
#### Hardware
|
| 161 |
-
|
| 162 |
-
[More Information Needed]
|
| 163 |
-
|
| 164 |
-
#### Software
|
| 165 |
-
|
| 166 |
-
[More Information Needed]
|
| 167 |
-
|
| 168 |
-
## Citation [optional]
|
| 169 |
-
|
| 170 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 171 |
-
|
| 172 |
-
**BibTeX:**
|
| 173 |
-
|
| 174 |
-
[More Information Needed]
|
| 175 |
-
|
| 176 |
-
**APA:**
|
| 177 |
-
|
| 178 |
-
[More Information Needed]
|
| 179 |
-
|
| 180 |
-
## Glossary [optional]
|
| 181 |
-
|
| 182 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 183 |
-
|
| 184 |
-
[More Information Needed]
|
| 185 |
-
|
| 186 |
-
## More Information [optional]
|
| 187 |
|
| 188 |
-
|
|
|
|
| 189 |
|
| 190 |
-
|
|
|
|
|
|
|
| 191 |
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
| 193 |
|
| 194 |
-
|
| 195 |
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
license: mit
|
| 2 |
pipeline_tag: text-generation
|
| 3 |
tags:
|
|
|
|
| 11 |
- Mayura01/T-CLM2
|
| 12 |
library_name: transformers
|
| 13 |
---
|
| 14 |
+
# Model Card for T-CLM2
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
This model card provides essential information about the T-CLM2 model, designed for text generation tasks. It has been generated using the [Hugging Face template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
| 17 |
|
| 18 |
## Model Details
|
| 19 |
|
| 20 |
### Model Description
|
| 21 |
|
| 22 |
+
T-CLM2 is a transformer-based model specifically designed for text generation. It can generate coherent and contextually relevant text based on input prompts, making it suitable for various applications such as creative writing, content generation, and more.
|
|
|
|
|
|
|
| 23 |
|
| 24 |
- **Developed by:** Mayura
|
| 25 |
- **Model type:** Transformer Decoder only model
|
| 26 |
+
- **Language(s):** English
|
| 27 |
|
| 28 |
## Uses
|
| 29 |
|
|
|
|
|
|
|
| 30 |
### Direct Use
|
| 31 |
|
| 32 |
+
The model is intended for generating text based on user-defined prompts. Users can input any text, and the model will generate a continuation that is coherent and contextually relevant.
|
|
|
|
|
|
|
| 33 |
|
| 34 |
### Downstream Use [optional]
|
| 35 |
|
| 36 |
+
T-CLM2 can be integrated into applications that require text generation capabilities, such as chatbots, content creation tools, or automated storytelling applications.
|
|
|
|
|
|
|
| 37 |
|
| 38 |
### Out-of-Scope Use
|
| 39 |
|
| 40 |
+
The model should not be used for generating harmful or malicious content, including but not limited to hate speech, misinformation, or illegal content. It may also not perform well for tasks that require specific domain knowledge or factual accuracy.
|
|
|
|
|
|
|
| 41 |
|
| 42 |
## Bias, Risks, and Limitations
|
| 43 |
|
| 44 |
+
While T-CLM2 has been trained to generate diverse text, it may reflect biases present in the training data. Users should be cautious and review generated outputs for appropriateness and accuracy, particularly in sensitive contexts.
|
|
|
|
|
|
|
| 45 |
|
| 46 |
### Recommendations
|
| 47 |
|
| 48 |
+
Users should understand the potential biases in the generated text and verify outputs for accuracy, especially in applications with significant impacts (e.g., legal or medical advice).
|
|
|
|
|
|
|
| 49 |
|
| 50 |
## How to Get Started with the Model
|
| 51 |
|
| 52 |
+
To get started, you can use the following code snippet:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
|
| 57 |
+
model_name = "Mayura01/T-CLM2"
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 59 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 60 |
|
| 61 |
+
prompt = "Once upon a time in a faraway land,"
|
| 62 |
+
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
| 63 |
+
output = model.generate(input_ids, max_length=100)
|
| 64 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 65 |
|
| 66 |
+
print(generated_text)
|
| 67 |
|
| 68 |
+
@misc{T-CLM2,
|
| 69 |
+
author = {Mayura},
|
| 70 |
+
title = {T-CLM2: A Transformer Model for Text Generation},
|
| 71 |
+
year = {2024},
|
| 72 |
+
publisher = {Hugging Face}
|
| 73 |
+
}
|