Text Generation
Transformers
PyTorch
llama
instruction-tuning
text-generation-inference
text2text-generation
Instructions to use akoksal/LongForm-LLaMA-7B-diff with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akoksal/LongForm-LLaMA-7B-diff with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akoksal/LongForm-LLaMA-7B-diff")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-LLaMA-7B-diff") model = AutoModelForCausalLM.from_pretrained("akoksal/LongForm-LLaMA-7B-diff", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use akoksal/LongForm-LLaMA-7B-diff with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akoksal/LongForm-LLaMA-7B-diff" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akoksal/LongForm-LLaMA-7B-diff", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/akoksal/LongForm-LLaMA-7B-diff
- SGLang
How to use akoksal/LongForm-LLaMA-7B-diff 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 "akoksal/LongForm-LLaMA-7B-diff" \ --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": "akoksal/LongForm-LLaMA-7B-diff", "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 "akoksal/LongForm-LLaMA-7B-diff" \ --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": "akoksal/LongForm-LLaMA-7B-diff", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use akoksal/LongForm-LLaMA-7B-diff with Docker Model Runner:
docker model run hf.co/akoksal/LongForm-LLaMA-7B-diff
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,7 +41,7 @@ datasets:
|
|
| 41 |
- akoksal/LongForm
|
| 42 |
---
|
| 43 |
## LongForm-LLaMA-7B-diff
|
| 44 |
-
The LongForm dataset is created by leveraging English corpus examples with
|
| 45 |
|
| 46 |
Github Repo: https://github.com/akoksal/LongForm
|
| 47 |
|
|
@@ -114,12 +114,12 @@ Smaller versions of LongForm-OPT models are also available:
|
|
| 114 |
The LongForm dataset and models mainly focus on long text generation and have limitations regarding structured prediction tasks in NLP. Additionally, we observe that LongForm models may present hallucination problems similar to those found in LLMs.
|
| 115 |
|
| 116 |
## License
|
| 117 |
-
The LongForm project is subject to a MIT License with custom limitations for restrictions imposed by OpenAI (for the instruction generation part), as well as the license of language models (OPT, LLaMA, and T5).
|
| 118 |
|
| 119 |
## Citation
|
| 120 |
```
|
| 121 |
@misc{koksal2023longform,
|
| 122 |
-
title={LongForm:
|
| 123 |
author={Abdullatif Köksal and Timo Schick and Anna Korhonen and Hinrich Schütze},
|
| 124 |
year={2023},
|
| 125 |
eprint={2304.08460},
|
|
|
|
| 41 |
- akoksal/LongForm
|
| 42 |
---
|
| 43 |
## LongForm-LLaMA-7B-diff
|
| 44 |
+
The LongForm dataset is created by leveraging English corpus examples with reverse instructions. We select a diverse set of human-written documents from existing corpora such as C4 and Wikipedia and generate instructions for the given documents via LLMs. Then, we extend these examples with structured corpora examples such as Stack Exchange and WikiHow and task examples such as question answering, email writing, grammar error correction, story/poem generation, and text summarization.
|
| 45 |
|
| 46 |
Github Repo: https://github.com/akoksal/LongForm
|
| 47 |
|
|
|
|
| 114 |
The LongForm dataset and models mainly focus on long text generation and have limitations regarding structured prediction tasks in NLP. Additionally, we observe that LongForm models may present hallucination problems similar to those found in LLMs.
|
| 115 |
|
| 116 |
## License
|
| 117 |
+
The LongForm project is subject to a MIT License with custom limitations for restrictions imposed by OpenAI (for the instruction generation part), as well as the license of language models (OPT, LLaMA, and T5). The WikiHow subset of LongForm-C is subject to the license proposed by WikiHow.
|
| 118 |
|
| 119 |
## Citation
|
| 120 |
```
|
| 121 |
@misc{koksal2023longform,
|
| 122 |
+
title={LongForm: Effective Instruction Tuning with Reverse Instructions},
|
| 123 |
author={Abdullatif Köksal and Timo Schick and Anna Korhonen and Hinrich Schütze},
|
| 124 |
year={2023},
|
| 125 |
eprint={2304.08460},
|