Text Generation
Transformers
TensorBoard
Safetensors
English
gpt2
text-generation-inference
conversational
Instructions to use anktechsol/ankiGPT-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anktechsol/ankiGPT-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anktechsol/ankiGPT-small") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("anktechsol/ankiGPT-small") model = AutoModelForCausalLM.from_pretrained("anktechsol/ankiGPT-small", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anktechsol/ankiGPT-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anktechsol/ankiGPT-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anktechsol/ankiGPT-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/anktechsol/ankiGPT-small
- SGLang
How to use anktechsol/ankiGPT-small 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 "anktechsol/ankiGPT-small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anktechsol/ankiGPT-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "anktechsol/ankiGPT-small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anktechsol/ankiGPT-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use anktechsol/ankiGPT-small with Docker Model Runner:
docker model run hf.co/anktechsol/ankiGPT-small
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,24 +1,32 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Model Card for AnkiGPT-small
|
| 7 |
|
| 8 |
-
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
| 9 |
-
|
| 10 |
## Model Details
|
| 11 |
|
| 12 |
### Model Description
|
| 13 |
|
| 14 |
- **Developed by:** [anktechsol.com](www.anktechsol.com)
|
| 15 |
-
- **Shared by:** [
|
| 16 |
- **Model type:** Causal Language Model
|
| 17 |
- **Language(s) (NLP):** English, potentially aspects of Indian languages/Hinglish due to fine-tuning data.
|
| 18 |
- **License:** (Specify the license of the fine-tuned model, often inherited from the base model or dataset. DialoGPT uses MIT license, check the dataset license.)
|
| 19 |
-
- **Finetuned from model
|
| 20 |
|
| 21 |
-
### Model Sources
|
| 22 |
|
| 23 |
- **Repository:** `https://huggingface.co/anktechsol/ankiGPT-small` (This will be the link after pushing to the hub)
|
| 24 |
|
|
@@ -43,20 +51,3 @@ Based on initial testing, the model may exhibit repetitive text generation, espe
|
|
| 43 |
### Recommendations
|
| 44 |
|
| 45 |
Users should be aware of the model's limitations in generating coherent long text and potential biases. It is recommended to experiment with different generation parameters (`max_length`, `no_repeat_ngram_size`, sampling strategies) to improve output quality. For any critical applications, thorough testing and human review of generated content are essential.
|
| 46 |
-
|
| 47 |
-
## How to Get Started with the Model
|
| 48 |
-
|
| 49 |
-
Use the code below to get started with the model using the `transformers` library.
|
| 50 |
-
|
| 51 |
-
from transformers import pipeline
|
| 52 |
-
|
| 53 |
-
# Replace "anktechsol/ankiGPT-small" with your actual model ID on the Hugging Face Hub
|
| 54 |
-
generator = pipeline("text-generation", model="anktechsol/ankiGPT-small")
|
| 55 |
-
|
| 56 |
-
# A detailed prompt related to India
|
| 57 |
-
prompt = "Write a short story about a day in the life of a student in a bustling Indian city, describing their commute, interactions at school, and a cultural event they attend in the evening. Keep it in hinglish"
|
| 58 |
-
|
| 59 |
-
# Generate text with a reasonable max_length to allow for a detailed story
|
| 60 |
-
generated_text = generator(prompt, max_length=300, num_return_sequences=1)
|
| 61 |
-
|
| 62 |
-
print(generated_text[0]['generated_text'])
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- ai4bharat/indic-align
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
metrics:
|
| 8 |
+
- accuracy
|
| 9 |
+
base_model:
|
| 10 |
+
- microsoft/DialoGPT-small
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: diffusers
|
| 13 |
+
tags:
|
| 14 |
+
- text-generation-inference
|
| 15 |
+
---
|
| 16 |
# Model Card for AnkiGPT-small
|
| 17 |
|
|
|
|
|
|
|
| 18 |
## Model Details
|
| 19 |
|
| 20 |
### Model Description
|
| 21 |
|
| 22 |
- **Developed by:** [anktechsol.com](www.anktechsol.com)
|
| 23 |
+
- **Shared by:** [anktechsol]
|
| 24 |
- **Model type:** Causal Language Model
|
| 25 |
- **Language(s) (NLP):** English, potentially aspects of Indian languages/Hinglish due to fine-tuning data.
|
| 26 |
- **License:** (Specify the license of the fine-tuned model, often inherited from the base model or dataset. DialoGPT uses MIT license, check the dataset license.)
|
| 27 |
+
- **Finetuned from model:** `microsoft/DialoGPT-small`
|
| 28 |
|
| 29 |
+
### Model Sources
|
| 30 |
|
| 31 |
- **Repository:** `https://huggingface.co/anktechsol/ankiGPT-small` (This will be the link after pushing to the hub)
|
| 32 |
|
|
|
|
| 51 |
### Recommendations
|
| 52 |
|
| 53 |
Users should be aware of the model's limitations in generating coherent long text and potential biases. It is recommended to experiment with different generation parameters (`max_length`, `no_repeat_ngram_size`, sampling strategies) to improve output quality. For any critical applications, thorough testing and human review of generated content are essential.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|