Spaces:
Build error
Build error
bankholdup
commited on
Commit
•
25e32d7
1
Parent(s):
454824a
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,8 @@ import transformers
|
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
import streamlit as st
|
5 |
-
import re
|
6 |
|
7 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
8 |
-
from transformers import pipeline
|
9 |
|
10 |
@st.cache(allow_output_mutation=True)
|
11 |
def load_model():
|
@@ -55,7 +53,7 @@ if st.button("Поехали", help="Может занять какое-то в
|
|
55 |
prompt_text + text[len(tokenizer.decode(encoded_prompt[0], clean_up_tokenization_spaces=True)) :]
|
56 |
)
|
57 |
|
58 |
-
|
59 |
|
60 |
#generated_sequences.append(total_sequence)
|
61 |
st.write(total_sequence)
|
|
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
import streamlit as st
|
|
|
5 |
|
6 |
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
|
|
7 |
|
8 |
@st.cache(allow_output_mutation=True)
|
9 |
def load_model():
|
|
|
53 |
prompt_text + text[len(tokenizer.decode(encoded_prompt[0], clean_up_tokenization_spaces=True)) :]
|
54 |
)
|
55 |
|
56 |
+
reformat_seq = ''.join(['\n'+ x if x.isupper() else x for x in total_sequence ])
|
57 |
|
58 |
#generated_sequences.append(total_sequence)
|
59 |
st.write(total_sequence)
|