Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
generator = pipeline('text-generation', model='
|
5 |
|
6 |
def generate(text):
|
7 |
-
result = generator(text, max_length=
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
generator = pipeline('text-generation', model='sberbank-ai/rugpt3small_based_on_gpt2')
|
5 |
|
6 |
def generate(text):
|
7 |
+
result = generator(text, max_length=300, temperature=0.7, num_return_sequences=1, do_sample=True)
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|