AliMaatouk commited on
Commit
8e41106
·
verified ·
1 Parent(s): f44d8ac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -3
README.md CHANGED
@@ -1,3 +1,93 @@
1
- ---
2
- license: llama3.2
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3.2
3
+ language:
4
+ - en
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - nlp
8
+ ---
9
+
10
+ # Llama-3.2-1B-Tele-it Model Card
11
+
12
+ ## Model Summary
13
+
14
+ The language model Llama-3.2-1B-Tele-it is an instruct version of [Llama-3.2-1B-Tele](https://huggingface.co/AliMaatouk/Llama-3.2-1B-Tele), which is based on Meta [Llama-3.2-1B](https://huggingface.co/meta-llama/Llama-3.2-1B) 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
+
17
+ ### Context Length
18
+
19
+ The context length of the model is 8192 tokens.
20
+
21
+ ## Usage
22
+
23
+ Llama-3.2-1B-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:
24
+
25
+ ```markdown
26
+ Prompt: Shannon capacity is
27
+
28
+ Model: The Shannon capacity is a measure of the maximum amount of information that can be transmitted through a communication channel over a given time period. It is a measure of the channel capacity that takes into account the signal-to-noise ratio (SNR) of the channel and the channel's bandwidth.
29
+
30
+ The formula for the Shannon capacity of a communication channel is:
31
+
32
+ C = log2(1 + SNR)
33
+
34
+ Where:
35
+ C = Shannon capacity
36
+ SNR = Signal-to-Noise Ratio
37
+ ```
38
+
39
+ ## Sample Code
40
+
41
+ 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.
42
+
43
+ #### Running the model on a CPU
44
+
45
+
46
+ ```python
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+
49
+ model = AutoModelForCausalLM.from_pretrained("AliMaatouk/Llama-3.2-1B-Tele-it", torch_dtype="auto")
50
+ tokenizer = AutoTokenizer.from_pretrained("AliMaatouk/Llama-3.2-1B-Tele-it")
51
+
52
+ prompt = "Explain to me Shannon capacity.\n"
53
+ input_ids = tokenizer(prompt, return_tensors="pt")
54
+ outputs = model.generate(**input_ids, max_new_tokens=100)
55
+
56
+ generated_tokens = outputs[0, len(input_ids['input_ids'][0]):]
57
+ response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
58
+ print(response)
59
+ ```
60
+
61
+ #### Running the model on a single / multi GPU
62
+
63
+ ```python
64
+ import torch
65
+ from transformers import AutoModelForCausalLM, AutoTokenizer
66
+
67
+ model = AutoModelForCausalLM.from_pretrained("AliMaatouk/Llama-3.2-1B-Tele-it", torch_dtype="auto", device_map="auto")
68
+ tokenizer = AutoTokenizer.from_pretrained("AliMaatouk/Llama-3.2-1B-Tele-it")
69
+
70
+ prompt = "Explain to me Shannon capacity.\n"
71
+ input_ids = tokenizer(prompt, return_tensors="pt").to("cuda")
72
+ outputs = model.generate(**input_ids, max_new_tokens=100)
73
+
74
+ generated_tokens = outputs[0, len(input_ids['input_ids'][0]):]
75
+ response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
76
+ print(response)
77
+ ```
78
+
79
+ ## Citation
80
+
81
+ You can find the paper with all details about the model at https://arxiv.org/abs/2409.05314. Please cite it as follows:
82
+
83
+ ```bib
84
+ @misc{maatouk2024telellmsseriesspecializedlarge,
85
+ title={Tele-LLMs: A Series of Specialized Large Language Models for Telecommunications},
86
+ author={Ali Maatouk and Kenny Chirino Ampudia and Rex Ying and Leandros Tassiulas},
87
+ year={2024},
88
+ eprint={2409.05314},
89
+ archivePrefix={arXiv},
90
+ primaryClass={cs.IT},
91
+ url={https://arxiv.org/abs/2409.05314},
92
+ }
93
+ ```