Spaces:
Sleeping
Sleeping
wannaphong
commited on
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='wannaphong/
|
5 |
|
6 |
def generate(text):
|
7 |
-
return generator(text,max_new_tokens=
|
8 |
# return result[0]["generated_text"] # type: ignore
|
9 |
|
10 |
examples = [
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
generator = pipeline('text-generation', model='wannaphong/mark2')
|
5 |
|
6 |
def generate(text):
|
7 |
+
return generator(text,max_new_tokens=124)[0]["generated_text"] # use yield from#result = generator(text, max_length=30, num_return_sequences=1)
|
8 |
# return result[0]["generated_text"] # type: ignore
|
9 |
|
10 |
examples = [
|