How to use from
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 "m3hrdadfi/gpt2-persian-qa" \
    --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": "m3hrdadfi/gpt2-persian-qa",
		"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 "m3hrdadfi/gpt2-persian-qa" \
        --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": "m3hrdadfi/gpt2-persian-qa",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

GPT2 QA - Persian

It is a new approach to using GPT2 in other downstream NLP tasks like QA. The model was trained on PersianQA and evaluated on PersianQA and PersiNLU (Reading Comprehension).

Dataset

Evaluation

The following table summarizes the scores obtained by the model.

Dataset F1 Score (%) Exact Match (%) Total (#)
ParsNLU 46.95 20.39 564
PersianQA 45.93 23.19 651

Demo

Streamlit GPT2 QA - Persian

How to use

TODO (will be filled shortly)...

Downloads last month
27
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train m3hrdadfi/gpt2-persian-qa

Space using m3hrdadfi/gpt2-persian-qa 1