motexture commited on
Commit
fdcea06
·
verified ·
1 Parent(s): f6d10ae

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -3
README.md CHANGED
@@ -1,3 +1,74 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - de
5
+ - fr
6
+ - it
7
+ - pt
8
+ - hi
9
+ - es
10
+ - th
11
+ library_name: transformers
12
+ pipeline_tag: text-generation
13
+ tags:
14
+ - facebook
15
+ - meta
16
+ - pytorch
17
+ - llama
18
+ - llama-3
19
+ license: llama3.2
20
+ base_model:
21
+ - meta-llama/Llama-3.2-1B-Instruct
22
+ ---
23
+
24
+ # iTech-1B-Instruct
25
+
26
+ ## Introduction
27
+
28
+ iTech-1B-Instruct is a fine-tuned version of Llama-3.2.1B-Instruct, trained on the iData dataset.
29
+
30
+ ## Quickstart
31
+
32
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
33
+
34
+ ```python
35
+ from transformers import AutoModelForCausalLM, AutoTokenizer
36
+ device = "cuda" # the device to load the model onto
37
+
38
+ model = AutoModelForCausalLM.from_pretrained(
39
+ "motexture/iTech-1B-Instruct",
40
+ torch_dtype="auto",
41
+ device_map="auto"
42
+ )
43
+ tokenizer = AutoTokenizer.from_pretrained("motexture/iTech-1B-Instruct")
44
+
45
+ prompt = "Write a C++ program that demonstrates the concept of separate compilation and linkage using namespaces and header files. The program should consist of multiple source files, each containing a portion of the program's code, and a header file that contains the interface information for the program.\n\nThe program should define a namespace my_namespace that contains a class MyClass with a member function print() that takes an integer as an argument. The program should also define a function main() that uses an object of the MyClass class to print a message.\n\nThe program should be compiled and linked separately, with each source file being compiled individually and then linked together to form the final executable."
46
+ messages = [
47
+ {"role": "system", "content": "You are a helpful assistant."},
48
+ {"role": "user", "content": prompt}
49
+ ]
50
+ text = tokenizer.apply_chat_template(
51
+ messages,
52
+ tokenize=False,
53
+ add_generation_prompt=True
54
+ )
55
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
56
+
57
+ generated_ids = model.generate(
58
+ model_inputs.input_ids,
59
+ max_new_tokens=4096
60
+ )
61
+ generated_ids = [
62
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
63
+ ]
64
+
65
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
66
+ ```
67
+
68
+ ## Responsibility & Safety
69
+
70
+ As part of our Responsible release approach, we followed a three-pronged strategy to managing trust & safety risks:
71
+
72
+ 1. Enable developers to deploy helpful, safe and flexible experiences for their target audience and for the use cases supported by Llama
73
+ 2. Protect developers against adversarial users aiming to exploit Llama capabilities to potentially cause harm
74
+ 3. Provide protections for the community to help prevent the misuse of our models