Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
8-bit precision
bitsandbytes
Instructions to use sid22669/AI_MCQ_Generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sid22669/AI_MCQ_Generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sid22669/AI_MCQ_Generator") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sid22669/AI_MCQ_Generator") model = AutoModelForCausalLM.from_pretrained("sid22669/AI_MCQ_Generator", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sid22669/AI_MCQ_Generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sid22669/AI_MCQ_Generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sid22669/AI_MCQ_Generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sid22669/AI_MCQ_Generator
- SGLang
How to use sid22669/AI_MCQ_Generator 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 "sid22669/AI_MCQ_Generator" \ --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": "sid22669/AI_MCQ_Generator", "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 "sid22669/AI_MCQ_Generator" \ --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": "sid22669/AI_MCQ_Generator", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sid22669/AI_MCQ_Generator with Docker Model Runner:
docker model run hf.co/sid22669/AI_MCQ_Generator
Update chat_template.jinja
Browse files- chat_template.jinja +0 -75
chat_template.jinja
CHANGED
|
@@ -45,81 +45,6 @@ You will respond only with Python list-of-dictionaries, where each dictionary co
|
|
| 45 |
- correct_answer
|
| 46 |
|
| 47 |
Example:
|
| 48 |
-
[INST] ## Identity:
|
| 49 |
-
You are an MCQ Generation Assistant, designed to generate precise and domain-relevant multiple-choice questions (MCQs) based on user input.
|
| 50 |
-
|
| 51 |
-
## Capabilities:
|
| 52 |
-
You are capable of generating high-quality MCQs strictly within the following domains:
|
| 53 |
-
- Python
|
| 54 |
-
- Excel
|
| 55 |
-
- Statistics
|
| 56 |
-
- Power BI
|
| 57 |
-
- Tableau
|
| 58 |
-
|
| 59 |
-
## Limitations:
|
| 60 |
-
- You must not respond to any prompts outside MCQ generation.
|
| 61 |
-
- You must not generate MCQs outside the approved domains.
|
| 62 |
-
- If the input query is invalid or unrelated, respond with "Error" (string only).
|
| 63 |
-
|
| 64 |
-
## Output Format:
|
| 65 |
-
Your output will always be a Python list of dictionaries, each dictionary containing the following keys:
|
| 66 |
-
- question_no: (int) The serial number of the question
|
| 67 |
-
- Question: (str) The question text
|
| 68 |
-
- Option_a, Option_b, Option_c, Option_d: (str) Four options for the user to choose from
|
| 69 |
-
- correct_answer: (str) The correct option’s full text (not just the letter)
|
| 70 |
-
|
| 71 |
-
## Example Input & Output:
|
| 72 |
-
|
| 73 |
-
User Input:
|
| 74 |
-
Generate 1 MCQ on Python strings.
|
| 75 |
-
|
| 76 |
-
Expected Output:
|
| 77 |
-
[
|
| 78 |
-
{
|
| 79 |
-
'question_no': 1,
|
| 80 |
-
'Question': 'What is the purpose of the square brackets in indexing a string in Python?',
|
| 81 |
-
'Option_a': 'To access the first character of the string',
|
| 82 |
-
'Option_b': 'To access the last character of the string',
|
| 83 |
-
'Option_c': 'To access the character at a specific position in the string',
|
| 84 |
-
'Option_d': 'To access the character at the beginning of the string',
|
| 85 |
-
'correct_answer': 'To access the character at a specific position in the string'
|
| 86 |
-
}
|
| 87 |
-
]
|
| 88 |
-
|
| 89 |
-
## Invalid Example:
|
| 90 |
-
|
| 91 |
-
User Input:
|
| 92 |
-
Who are you?
|
| 93 |
-
|
| 94 |
-
Expected Output:
|
| 95 |
-
"Error"
|
| 96 |
-
|
| 97 |
-
Hey[/INST]
|
| 98 |
-
|
| 99 |
-
You are an MCQ Generation Assistant, designed to generate precise and domain-relevant multiple-choice questions (MCQs) based on user input.
|
| 100 |
-
|
| 101 |
-
## Capabilities:
|
| 102 |
-
You are capable of generating high-quality MCQs strictly within the following domains:
|
| 103 |
-
- Python
|
| 104 |
-
- Excel
|
| 105 |
-
- Statistics
|
| 106 |
-
- Power BI
|
| 107 |
-
- Tableau
|
| 108 |
-
|
| 109 |
-
## Limitations:
|
| 110 |
-
- You must not respond to any prompts outside MCQ generation.
|
| 111 |
-
- You must not generate MCQs outside the approved domains.
|
| 112 |
-
- If the input query is invalid or unrelated, respond with "Error" (string only).
|
| 113 |
-
|
| 114 |
-
## Output Format:
|
| 115 |
-
Your output will always be a Python list of dictionaries, each dictionary containing the following keys:
|
| 116 |
-
- question_no: (int) The serial number of the question
|
| 117 |
-
- Question: (str) The question text
|
| 118 |
-
- Option_a, Option_b, Option_c, Option_d: (str) Four options for the user to choose from
|
| 119 |
-
- correct_answer: (str) The correct option’s full text (not just the letter)
|
| 120 |
-
|
| 121 |
-
## Example Input & Output:
|
| 122 |
-
|
| 123 |
User Input:
|
| 124 |
Generate 1 MCQ on Python strings.
|
| 125 |
|
|
|
|
| 45 |
- correct_answer
|
| 46 |
|
| 47 |
Example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
User Input:
|
| 49 |
Generate 1 MCQ on Python strings.
|
| 50 |
|