jackdoczy commited on
Commit
4f06eb8
1 Parent(s): 4a505ef

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -1
README.md CHANGED
@@ -6,4 +6,76 @@ language:
6
  - en
7
  base_model:
8
  - black-forest-labs/FLUX.1-dev
9
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  - en
7
  base_model:
8
  - black-forest-labs/FLUX.1-dev
9
+ ---
10
+ #This prompt is from message 2. #The goal is to generate 100 messages per prompt.
11
+
12
+ prompt2 = "Vaping is risky"
13
+
14
+ #Below, we specify to use pytorch machine learning framework.
15
+ #You can also choose Tensorflow, but we use Pytorch here.
16
+
17
+ inputs = tokenizer(prompt2, return_tensors="pt")
18
+ ---
19
+ #We generate 50 messages each time due to restrictions in Ram storage.
20
+
21
+ sample_outputs = bloom.generate(inputs["input_ids"],
22
+ temperature = 0.7,
23
+ max_new_tokens = 60,
24
+ do_sample=True,
25
+ top_k=40,
26
+ top_p=0.9,
27
+ num_return_sequences=50
28
+ )
29
+
30
+ print("Output:\n" + 100 * '-')
31
+ messages = []
32
+ for i, sample_output in enumerate(sample_outputs):
33
+ generated_messages = tokenizer.decode(sample_output, skip_special_tokens=True)
34
+ print("{}: {}".format(i, generated_messages))
35
+ messages.append(generated_messages)
36
+
37
+ print(messages)
38
+ ---
39
+ #We save the AI-generated messages to google drive.
40
+
41
+ AI_messages = pd.DataFrame(messages, columns = ['tweet'])
42
+ AI_messages.to_csv('Vaping is risky1.csv', index = False)
43
+ ---
44
+ #Then generate another 50 messages with prompt1 and then save to google drive.
45
+
46
+ AI_messages = pd.DataFrame(messages, columns = ['tweet'])
47
+ AI_messages.to_csv('Vaping is risky2.csv', index = False)
48
+ ---
49
+ #This prompt is from message 3. #The goal is to generate 100 messages per prompt.
50
+
51
+ prompt3 = "Vapes and e-cigarettes increase your risk"
52
+
53
+ #Below, we specify to use pytorch machine learning framework.
54
+ #You can also choose Tensorflow, but we use Pytorch here.
55
+
56
+ inputs = tokenizer(prompt3, return_tensors="pt")
57
+ ---
58
+ #We generate 50 messages each time due to restrictions in Ram storage.
59
+
60
+ sample_outputs = bloom.generate(inputs["input_ids"],
61
+ temperature = 0.7,
62
+ max_new_tokens = 60,
63
+ do_sample=True,
64
+ top_k=40,
65
+ top_p=0.9,
66
+ num_return_sequences=50
67
+ )
68
+
69
+ print("Output:\n" + 100 * '-')
70
+ messages = []
71
+ for i, sample_output in enumerate(sample_outputs):
72
+ generated_messages = tokenizer.decode(sample_output, skip_special_tokens=True)
73
+ print("{}: {}".format(i, generated_messages))
74
+ messages.append(generated_messages)
75
+
76
+ print(messages)
77
+ ---
78
+ #We save the AI-generated messages to google drive.
79
+
80
+ AI_messages = pd.DataFrame(messages, columns = ['tweet'])
81
+ AI_messages.to_csv('Vapes and e-cigarettes increase your risk1.csv', index = False)