Teery commited on
Commit
f1f9e9e
1 Parent(s): 2f84235
Files changed (3) hide show
  1. app.py +2 -0
  2. pages/seduce.py +28 -0
  3. requirements.txt +66 -0
app.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import streamlit as st
2
+ st.header('Ассаламу алейкум, братья славяне')
pages/seduce.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import GPT2LMHeadModel, GPT2Tokenizer, TextDataset, DataCollatorForLanguageModeling, Trainer, TrainingArguments
3
+ import torch
4
+ st.header('Генератор плохих подкатов')
5
+
6
+ tokenizer = GPT2Tokenizer.from_pretrained('SeducerWeight/repo_name')
7
+ model = GPT2LMHeadModel.from_pretrained('SeducerWeight/repo_name', from_tf=False)
8
+
9
+ text = st.text_input("Кринжовое начало")
10
+ max_length = st.slider('Выберите длину', 30, 150, 40, 5)
11
+ temp = st.slider('Выберите температуру', 1.5, 4.0, 2.0, 0.25)
12
+ top_p = st.slider('Выберите top_p', 1.5, 4.0, 2.0, 0.25)
13
+ if text and max_length and temp and top_p:
14
+ input_ids = tokenizer.encode(text, return_tensors="pt")
15
+
16
+ model.eval()
17
+ with torch.no_grad():
18
+ out = model.generate(input_ids,
19
+ do_sample=True,
20
+ num_beams=3,
21
+ temperature=temp,
22
+ top_p=top_p,
23
+ max_length=max_length,
24
+ )
25
+
26
+ generated_text = list(map(tokenizer.decode, out))
27
+ count = st.number_input('Введите количество подкатов', 1, 5, 1)
28
+ st.write(generated_text[0].split('\n')[count-1])
requirements.txt ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiohttp==3.8.5
2
+ aiosignal==1.3.1
3
+ altair==5.1.1
4
+ async-timeout==4.0.3
5
+ attrs==23.1.0
6
+ blinker==1.6.2
7
+ cachetools==5.3.1
8
+ certifi==2023.7.22
9
+ charset-normalizer==3.2.0
10
+ click==8.1.7
11
+ datasets==2.14.5
12
+ dill==0.3.7
13
+ filelock==3.12.4
14
+ frozenlist==1.4.0
15
+ fsspec==2023.6.0
16
+ gitdb==4.0.10
17
+ GitPython==3.1.37
18
+ huggingface-hub==0.17.3
19
+ idna==3.4
20
+ importlib-metadata==6.8.0
21
+ Jinja2==3.1.2
22
+ jsonschema==4.19.1
23
+ jsonschema-specifications==2023.7.1
24
+ markdown-it-py==3.0.0
25
+ MarkupSafe==2.1.3
26
+ mdurl==0.1.2
27
+ mpmath==1.3.0
28
+ multidict==6.0.4
29
+ multiprocess==0.70.15
30
+ networkx==3.1
31
+ numpy==1.26.0
32
+ packaging==23.1
33
+ pandas==2.1.1
34
+ Pillow==9.5.0
35
+ protobuf==4.24.3
36
+ pyarrow==13.0.0
37
+ pydeck==0.8.1b0
38
+ Pygments==2.16.1
39
+ python-dateutil==2.8.2
40
+ pytz==2023.3.post1
41
+ PyYAML==6.0.1
42
+ referencing==0.30.2
43
+ regex==2023.8.8
44
+ requests==2.31.0
45
+ rich==13.5.3
46
+ rpds-py==0.10.3
47
+ six==1.16.0
48
+ smmap==5.0.1
49
+ streamlit==1.27.0
50
+ sympy==1.12
51
+ tenacity==8.2.3
52
+ tokenizers==0.13.3
53
+ toml==0.10.2
54
+ toolz==0.12.0
55
+ torch==2.0.1
56
+ tornado==6.3.3
57
+ tqdm==4.66.1
58
+ transformers==4.28.0
59
+ typing_extensions==4.8.0
60
+ tzdata==2023.3
61
+ tzlocal==5.0.1
62
+ urllib3==2.0.5
63
+ validators==0.22.0
64
+ xxhash==3.3.0
65
+ yarl==1.9.2
66
+ zipp==3.17.0