Spaces:
Runtime error
Runtime error
Fix some bugs
Browse files
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
title: GPT2 Persian
|
3 |
emoji: π€
|
4 |
-
colorFrom:
|
5 |
colorTo: red
|
6 |
sdk: streamlit
|
7 |
app_file: app.py
|
|
|
1 |
---
|
2 |
title: GPT2 Persian
|
3 |
emoji: π€
|
4 |
+
colorFrom: yellow
|
5 |
colorTo: red
|
6 |
sdk: streamlit
|
7 |
app_file: app.py
|
app.py
CHANGED
@@ -33,7 +33,7 @@ class TextGeneration:
|
|
33 |
if not self.debug:
|
34 |
generation_kwargs["num_return_sequences"] = 1
|
35 |
|
36 |
-
max_length = len(self.tokenizer(prompt)["input_ids"]
|
37 |
generation_kwargs["max_length"] = max_length
|
38 |
|
39 |
return self.generator(
|
@@ -53,8 +53,8 @@ def load_text_generator():
|
|
53 |
|
54 |
def main():
|
55 |
st.set_page_config(
|
56 |
-
page_title="
|
57 |
-
page_icon="
|
58 |
layout="wide",
|
59 |
initial_sidebar_state="expanded"
|
60 |
)
|
|
|
33 |
if not self.debug:
|
34 |
generation_kwargs["num_return_sequences"] = 1
|
35 |
|
36 |
+
max_length = len(self.tokenizer(prompt)["input_ids"]) + generation_kwargs["max_length"]
|
37 |
generation_kwargs["max_length"] = max_length
|
38 |
|
39 |
return self.generator(
|
|
|
53 |
|
54 |
def main():
|
55 |
st.set_page_config(
|
56 |
+
page_title="GPT2 - Persian",
|
57 |
+
page_icon="π€",
|
58 |
layout="wide",
|
59 |
initial_sidebar_state="expanded"
|
60 |
)
|