Text Generation
Transformers
PyTorch
TensorFlow
JAX
TensorBoard
Safetensors
Arabic
gpt2
text-generation-inference
Instructions to use aubmindlab/aragpt2-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aubmindlab/aragpt2-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aubmindlab/aragpt2-medium")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aubmindlab/aragpt2-medium") model = AutoModelForCausalLM.from_pretrained("aubmindlab/aragpt2-medium", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aubmindlab/aragpt2-medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aubmindlab/aragpt2-medium" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aubmindlab/aragpt2-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aubmindlab/aragpt2-medium
- SGLang
How to use aubmindlab/aragpt2-medium 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 "aubmindlab/aragpt2-medium" \ --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": "aubmindlab/aragpt2-medium", "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 "aubmindlab/aragpt2-medium" \ --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": "aubmindlab/aragpt2-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aubmindlab/aragpt2-medium with Docker Model Runner:
docker model run hf.co/aubmindlab/aragpt2-medium
falcon_ar
#2
by MohammedAlsayani - opened
LICENSE
DELETED
|
@@ -1,77 +0,0 @@
|
|
| 1 |
-
==========================================
|
| 2 |
-
SOFTWARE LICENSE AGREEMENT - AraGPT2
|
| 3 |
-
==========================================
|
| 4 |
-
|
| 5 |
-
* NAME: AraGPT2: Pre-Training Text Discriminatorsfor Arabic Language Understanding
|
| 6 |
-
|
| 7 |
-
* ACKNOWLEDGMENTS
|
| 8 |
-
|
| 9 |
-
This [software] was generated by [American
|
| 10 |
-
University of Beirut] (“Owners”). The statements
|
| 11 |
-
made herein are solely the responsibility of the author[s].
|
| 12 |
-
|
| 13 |
-
The following software programs and programs have been used in the
|
| 14 |
-
generation of [AraGPT2]:
|
| 15 |
-
|
| 16 |
-
+ gpt-2-simple
|
| 17 |
-
- Max Woolf, 2020.
|
| 18 |
-
- License and link : https://github.com/minimaxir/gpt-2-simple
|
| 19 |
-
|
| 20 |
-
+ GPT2-ML
|
| 21 |
-
- Zhibo Zhang, GPT2-ML: GPT-2 for Multiple Languages, 2019
|
| 22 |
-
- License and link : https://github.com/imcaspar/gpt2-ml
|
| 23 |
-
|
| 24 |
-
+ PyArabic
|
| 25 |
-
- T. Zerrouki, Pyarabic, An Arabic language library for Python,
|
| 26 |
-
https://pypi.python.org/pypi/pyarabic/, 2010
|
| 27 |
-
- License and link: https://github.com/linuxscout/pyarabic/
|
| 28 |
-
|
| 29 |
-
* LICENSE
|
| 30 |
-
|
| 31 |
-
This software and database is being provided to you, the LICENSEE,
|
| 32 |
-
by the Owners under the following license. By obtaining, using and/or
|
| 33 |
-
copying this software and database, you agree that you have read,
|
| 34 |
-
understood, and will comply with these terms and conditions. You
|
| 35 |
-
further agree that you have read and you will abide by the license
|
| 36 |
-
agreements provided in the above links under “acknowledgements”:
|
| 37 |
-
Permission to use, copy, modify and distribute this software and
|
| 38 |
-
database and its documentation for any purpose and without fee or
|
| 39 |
-
royalty is hereby granted, provided that you agree to comply with the
|
| 40 |
-
following copyright notice and statements, including the disclaimer,
|
| 41 |
-
and that the same appear on ALL copies of the software, database and
|
| 42 |
-
documentation, including modifications that you make for internal use
|
| 43 |
-
or for distribution. [AraGPT2] Copyright 2020 by [American University
|
| 44 |
-
of Beirut]. All rights reserved. If you remix, transform, or build
|
| 45 |
-
upon the material, you must distribute your contributions under the
|
| 46 |
-
same license as this one. You may not apply legal terms or technological
|
| 47 |
-
measures that legally restrict others from doing anything this license
|
| 48 |
-
permits. THIS SOFTWARE IS PROVIDED "AS IS" AND THE OWNERS MAKE NO
|
| 49 |
-
REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE,
|
| 50 |
-
BUT NOT LIMITATION, THE OWNERS MAKE NO REPRESENTATIONS OR WARRANTIES OF
|
| 51 |
-
MERCHANT-ABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
|
| 52 |
-
THE LICENSED SOFTWARE, DATABASE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
|
| 53 |
-
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. The name of the
|
| 54 |
-
Owners may not be used in advertising or publicity pertaining to
|
| 55 |
-
distribution of the software and/or database. Title to copyright in
|
| 56 |
-
this software, database and any associated documentation shall at all
|
| 57 |
-
times remain with the Owners and LICENSEE agrees to preserve same.
|
| 58 |
-
|
| 59 |
-
The use of AraGPT2 should be cited as follows:
|
| 60 |
-
|
| 61 |
-
@inproceedings{antoun-etal-2021-aragpt2,
|
| 62 |
-
title = "{A}ra{GPT}2: Pre-Trained Transformer for {A}rabic Language Generation",
|
| 63 |
-
author = "Antoun, Wissam and
|
| 64 |
-
Baly, Fady and
|
| 65 |
-
Hajj, Hazem",
|
| 66 |
-
booktitle = "Proceedings of the Sixth Arabic Natural Language Processing Workshop",
|
| 67 |
-
month = apr,
|
| 68 |
-
year = "2021",
|
| 69 |
-
address = "Kyiv, Ukraine (Virtual)",
|
| 70 |
-
publisher = "Association for Computational Linguistics",
|
| 71 |
-
url = "https://www.aclweb.org/anthology/2021.wanlp-1.21",
|
| 72 |
-
pages = "196--207",
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
[AraGPT2] Copyright 2020 by [American University of Beirut].
|
| 76 |
-
All rights reserved.
|
| 77 |
-
==========================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|