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
Model Card for T-CLM2
This model card provides essential information about the T-CLM2 model, designed for text generation tasks.
Model Details
Model Description
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.
- Developed by: Mayura Patkar
- Model type: Transformer Decoder only model
- Language(s): English
Uses
Direct Use
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.
Downstream Use [optional]
T-CLM2 can be integrated into applications that require text generation capabilities, such as chatbots, content creation tools, or automated storytelling applications.
Out-of-Scope Use
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.
Bias, Risks, and Limitations
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.
Recommendations
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).
How to Get Started with the Model
To get started, you can use the following code snippet:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Mayura01/T-CLM2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
prompt = "Once upon a time in a faraway land,"
input_ids = tokenizer.encode(prompt, return_tensors="pt")
output = model.generate(input_ids, max_length=100)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
- Downloads last month
- 13