Text Generation
Transformers
PyTorch
English
bart
text2text-generation
question generation
Eval Results (legacy)
Instructions to use research-backup/bart-large-subjqa-electronics-qg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use research-backup/bart-large-subjqa-electronics-qg with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="research-backup/bart-large-subjqa-electronics-qg")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("research-backup/bart-large-subjqa-electronics-qg") model = AutoModelForSeq2SeqLM.from_pretrained("research-backup/bart-large-subjqa-electronics-qg") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use research-backup/bart-large-subjqa-electronics-qg with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "research-backup/bart-large-subjqa-electronics-qg" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "research-backup/bart-large-subjqa-electronics-qg", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/research-backup/bart-large-subjqa-electronics-qg
- SGLang
How to use research-backup/bart-large-subjqa-electronics-qg 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 "research-backup/bart-large-subjqa-electronics-qg" \ --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": "research-backup/bart-large-subjqa-electronics-qg", "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 "research-backup/bart-large-subjqa-electronics-qg" \ --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": "research-backup/bart-large-subjqa-electronics-qg", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use research-backup/bart-large-subjqa-electronics-qg with Docker Model Runner:
docker model run hf.co/research-backup/bart-large-subjqa-electronics-qg
model update
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ widget:
|
|
| 21 |
- text: "Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, <hl> Cadillac Records <hl> ."
|
| 22 |
example_title: "Question Generation Example 3"
|
| 23 |
model-index:
|
| 24 |
-
- name: lmqg/bart-large-subjqa-electronics
|
| 25 |
results:
|
| 26 |
- task:
|
| 27 |
name: Text2text Generation
|
|
@@ -48,9 +48,9 @@ model-index:
|
|
| 48 |
value: 65.68
|
| 49 |
---
|
| 50 |
|
| 51 |
-
# Model Card of `lmqg/bart-large-subjqa-electronics`
|
| 52 |
This model is fine-tuned version of [lmqg/bart-large-squad](https://huggingface.co/lmqg/bart-large-squad) for question generation task on the [lmqg/qg_subjqa](https://huggingface.co/datasets/lmqg/qg_subjqa) (dataset_name: electronics) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
| 53 |
-
|
| 54 |
|
| 55 |
### Overview
|
| 56 |
- **Language model:** [lmqg/bart-large-squad](https://huggingface.co/lmqg/bart-large-squad)
|
|
@@ -66,7 +66,7 @@ This model is continuously fine-tuned with [lmqg/bart-large-squad](https://huggi
|
|
| 66 |
from lmqg import TransformersQG
|
| 67 |
|
| 68 |
# initialize model
|
| 69 |
-
model = TransformersQG(language="en", model="lmqg/bart-large-subjqa-electronics")
|
| 70 |
|
| 71 |
# model prediction
|
| 72 |
questions = model.generate_q(list_context="William Turner was an English painter who specialised in watercolour landscapes", list_answer="William Turner")
|
|
@@ -77,7 +77,7 @@ questions = model.generate_q(list_context="William Turner was an English painter
|
|
| 77 |
```python
|
| 78 |
from transformers import pipeline
|
| 79 |
|
| 80 |
-
pipe = pipeline("text2text-generation", "lmqg/bart-large-subjqa-electronics")
|
| 81 |
output = pipe("<hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.")
|
| 82 |
|
| 83 |
```
|
|
@@ -85,7 +85,7 @@ output = pipe("<hl> Beyonce <hl> further expanded her acting career, starring as
|
|
| 85 |
## Evaluation
|
| 86 |
|
| 87 |
|
| 88 |
-
- ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/bart-large-subjqa-electronics/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_subjqa.electronics.json)
|
| 89 |
|
| 90 |
| | Score | Type | Dataset |
|
| 91 |
|:-----------|--------:|:------------|:-----------------------------------------------------------------|
|
|
@@ -119,7 +119,7 @@ The following hyperparameters were used during fine-tuning:
|
|
| 119 |
- gradient_accumulation_steps: 8
|
| 120 |
- label_smoothing: 0.15
|
| 121 |
|
| 122 |
-
The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/bart-large-subjqa-electronics/raw/main/trainer_config.json).
|
| 123 |
|
| 124 |
## Citation
|
| 125 |
```
|
|
|
|
| 21 |
- text: "Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, <hl> Cadillac Records <hl> ."
|
| 22 |
example_title: "Question Generation Example 3"
|
| 23 |
model-index:
|
| 24 |
+
- name: lmqg/bart-large-subjqa-electronics-qg
|
| 25 |
results:
|
| 26 |
- task:
|
| 27 |
name: Text2text Generation
|
|
|
|
| 48 |
value: 65.68
|
| 49 |
---
|
| 50 |
|
| 51 |
+
# Model Card of `lmqg/bart-large-subjqa-electronics-qg`
|
| 52 |
This model is fine-tuned version of [lmqg/bart-large-squad](https://huggingface.co/lmqg/bart-large-squad) for question generation task on the [lmqg/qg_subjqa](https://huggingface.co/datasets/lmqg/qg_subjqa) (dataset_name: electronics) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
| 53 |
+
|
| 54 |
|
| 55 |
### Overview
|
| 56 |
- **Language model:** [lmqg/bart-large-squad](https://huggingface.co/lmqg/bart-large-squad)
|
|
|
|
| 66 |
from lmqg import TransformersQG
|
| 67 |
|
| 68 |
# initialize model
|
| 69 |
+
model = TransformersQG(language="en", model="lmqg/bart-large-subjqa-electronics-qg")
|
| 70 |
|
| 71 |
# model prediction
|
| 72 |
questions = model.generate_q(list_context="William Turner was an English painter who specialised in watercolour landscapes", list_answer="William Turner")
|
|
|
|
| 77 |
```python
|
| 78 |
from transformers import pipeline
|
| 79 |
|
| 80 |
+
pipe = pipeline("text2text-generation", "lmqg/bart-large-subjqa-electronics-qg")
|
| 81 |
output = pipe("<hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.")
|
| 82 |
|
| 83 |
```
|
|
|
|
| 85 |
## Evaluation
|
| 86 |
|
| 87 |
|
| 88 |
+
- ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/bart-large-subjqa-electronics-qg/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_subjqa.electronics.json)
|
| 89 |
|
| 90 |
| | Score | Type | Dataset |
|
| 91 |
|:-----------|--------:|:------------|:-----------------------------------------------------------------|
|
|
|
|
| 119 |
- gradient_accumulation_steps: 8
|
| 120 |
- label_smoothing: 0.15
|
| 121 |
|
| 122 |
+
The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/bart-large-subjqa-electronics-qg/raw/main/trainer_config.json).
|
| 123 |
|
| 124 |
## Citation
|
| 125 |
```
|