初始化项目,由ModelHub XC社区提供模型
Model: oewis16/mistral-exam-generator Source: Original Platform
This commit is contained in:
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
language:
|
||||
- ar
|
||||
- en
|
||||
base_model: mistralai/Mistral-7B-v0.1
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- quiz-generator
|
||||
- exam-generator
|
||||
- educational
|
||||
---
|
||||
|
||||
# Mistral Exam Generator (كويز جينيريتور)
|
||||
|
||||
This model is a fine-tuned version of Mistral, specifically optimized for generating quizzes, exams, and educational questions based on given prompts or contexts.
|
||||
|
||||
## Model Description
|
||||
- **Task:** Text Generation / Question Generation (توليد أسئلة واختبارات)
|
||||
- **Languages Supported:** Arabic and English
|
||||
- **Intended Use:** Educational applications, teachers' assistance, and automatic quiz generation.
|
||||
|
||||
## How to use (كيفية الاستخدام برمجياً)
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
import torch
|
||||
|
||||
model_id = "oewis16/mistral-exam-generator"
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
model_id,
|
||||
torch_dtype=torch.float16,
|
||||
device_map="auto"
|
||||
)
|
||||
|
||||
prompt = "اكتب سؤال اختيار من متعدد عن الذكاء الاصطناعي مع الإجابات:"
|
||||
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
||||
outputs = model.generate(**inputs, max_new_tokens=150)
|
||||
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||
Reference in New Issue
Block a user