AliMaatouk
commited on
Commit
•
a472c39
1
Parent(s):
2491995
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,90 @@
|
|
1 |
-
---
|
2 |
-
license: llama3
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
tags:
|
7 |
+
- nlp
|
8 |
+
---
|
9 |
+
|
10 |
+
# LLama-3-8B-Tele-it Model Card
|
11 |
+
|
12 |
+
## Model Summary
|
13 |
+
|
14 |
+
The language model LLama-3-8B-Tele-it is an instruct version of [LLama-3-8B-Tele](https://huggingface.co/AliMaatouk/LLama-3-8B-Tele), which is based on Meta [LLama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) and specialized in telecommunications. It was fine-tuned to follow instructions using Supervised Fine-tuning (SFT) with a combination of the [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca) and [Open-instruct](https://huggingface.co/datasets/VMware/open-instruct) datasets.
|
15 |
+
|
16 |
+
### Context Length
|
17 |
+
|
18 |
+
The context length of the model is 8192 tokens.
|
19 |
+
|
20 |
+
## Usage
|
21 |
+
|
22 |
+
LLama-3-8B-Tele-it has been fine-tuned using pairs of instructions and responses from the [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca) and [Open-instruct](https://huggingface.co/datasets/VMware/open-instruct) datasets, separated by the "\n" delimiter. Below is an example of how to query the model using this format:
|
23 |
+
|
24 |
+
```markdown
|
25 |
+
Prompt: Explain to me Shannon capacity.\n
|
26 |
+
|
27 |
+
Model: Shannon capacity is a measure of the maximum amount of information that can be transmitted reliably over a noisy communication channel. It is named after the mathematician Claude Shannon, who developed the concept in the 1940s. The capacity of a channel is determined by the amount of noise that can be tolerated and the bandwidth of the channel.
|
28 |
+
|
29 |
+
The capacity of a channel is calculated using the formula:
|
30 |
+
|
31 |
+
C = B * log2(1 + SNR)
|
32 |
+
|
33 |
+
where C is the channel capacity, B is the bandwidth of the channel, and SNR is the signal-to-noise ratio.
|
34 |
+
```
|
35 |
+
|
36 |
+
## Sample Code
|
37 |
+
|
38 |
+
Below we share some code snippets on how to get quickly started with running the model. First, make sure to `pip install transformers`, then copy the snippet corresponding to your hardware and adapt it to your usecase.
|
39 |
+
|
40 |
+
#### Running the model on a CPU
|
41 |
+
|
42 |
+
|
43 |
+
```python
|
44 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
45 |
+
|
46 |
+
model = AutoModelForCausalLM.from_pretrained("AliMaatouk/LLama-3-8B-Tele-it", torch_dtype="auto")
|
47 |
+
tokenizer = AutoTokenizer.from_pretrained("AliMaatouk/LLama-3-8B-Tele-it")
|
48 |
+
|
49 |
+
prompt = "Explain to me Shannon capacity.\n"
|
50 |
+
input_ids = tokenizer(prompt, return_tensors="pt")
|
51 |
+
outputs = model.generate(**input_ids, max_new_tokens=100)
|
52 |
+
|
53 |
+
generated_tokens = outputs[0, len(input_ids['input_ids'][0]):]
|
54 |
+
response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
|
55 |
+
print(response)
|
56 |
+
```
|
57 |
+
|
58 |
+
#### Running the model on a single / multi GPU
|
59 |
+
|
60 |
+
```python
|
61 |
+
import torch
|
62 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
63 |
+
|
64 |
+
model = AutoModelForCausalLM.from_pretrained("AliMaatouk/LLama-3-8B-Tele-it", torch_dtype="auto", device_map="auto")
|
65 |
+
tokenizer = AutoTokenizer.from_pretrained("AliMaatouk/LLama-3-8B-Tele-it")
|
66 |
+
|
67 |
+
prompt = "Explain to me Shannon capacity.\n"
|
68 |
+
input_ids = tokenizer(prompt, return_tensors="pt").to("cuda")
|
69 |
+
outputs = model.generate(**input_ids, max_new_tokens=100)
|
70 |
+
|
71 |
+
generated_tokens = outputs[0, len(input_ids['input_ids'][0]):]
|
72 |
+
response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
|
73 |
+
print(response)
|
74 |
+
```
|
75 |
+
|
76 |
+
## Citation
|
77 |
+
|
78 |
+
You can find the paper with all details about the model at https://arxiv.org/abs/2409.05314. Please cite it as follows:
|
79 |
+
|
80 |
+
```bib
|
81 |
+
@misc{maatouk2024telellmsseriesspecializedlarge,
|
82 |
+
title={Tele-LLMs: A Series of Specialized Large Language Models for Telecommunications},
|
83 |
+
author={Ali Maatouk and Kenny Chirino Ampudia and Rex Ying and Leandros Tassiulas},
|
84 |
+
year={2024},
|
85 |
+
eprint={2409.05314},
|
86 |
+
archivePrefix={arXiv},
|
87 |
+
primaryClass={cs.IT},
|
88 |
+
url={https://arxiv.org/abs/2409.05314},
|
89 |
+
}
|
90 |
+
```
|